0

I've created observer for controller_action_postdispatch_adminhtml_permissions_user_roleGrid event, that is called on AJAX when filtering permission user grid. Problem is that I can't add custom column (with renderer) - how to get grid object from Varien_Event_Observer $observer?

2

I am not sure about when using ajax but I think the event core_block_abstract_prepare_layout_before maybe a better option. This event will give you the block and then you can simply call add column directly to it.

You can then get the block and validate the type and then call add column.

$block = $observer->getBlock();
if (!isset($block)) {
    return $this;
}
if ($block->getType() == 'the_type/you_need') {
    $block->addColumnAfter('your_column', array(
        'header'    => 'Your Column',
        'type'      => 'text',
        'index'     => 'your_column',
    ), 'column_to_go_after');
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.