1

I'm trying to remove some columns from customer grid, but is not working, I've tried several similar events, but none of them work.

my config.xml

<adminhtml>
    <events>
        <core_block_abstract_to_html_before>
            <observers>
                <manage_adminhtml>
                    <class>manage_adminhtml/observer</class>
                    <method>getCustomerGrid</method>
                </manage_adminhtml>
            </observers>
        </core_block_abstract_to_html_before>
    </events>
</adminhtml>

and my observer

class Manage_Adminhtml_Model_Observer
{
    public function getCustomerGrid( $observer )
    {
        $block = $observer->getEvent()->getBlock();

        if ($block->getId() == 'customerGrid') {

            $block->removeColumn('group');
            $block->removeColumn('email');

            $block->sortColumnsByOrder();
        }
    }
}

1 Answer 1

2

What you want to do can be achieved with GridControl.

We use the event adminhtml_block_html_before and then call $params->getBlock()->removeColumn($params->getColumn()->getName());

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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