I'd like to know how to remove a column in the sales order grid using an layout update.
I have the following layout update for add a column to the sales order grid. The Something
column gets added as the first column and removeColumn
(to remove the Order #
column ) action does nothing because when this layout update is performed, there are no columns added yet.
<layout>
<sales_order_grid_update>
<reference name="sales_order.grid">
<!-- removeColumn doesn't work because no columns have been added yet -->
<action method="removeColumn">
<columnId>real_order_id</columnId>
</action>
<!-- This column gets added as the first column in the grid -->
<action method="addColumnAfter">
<columnId>new_column</columnId>
<arguments>
<header>Something</header>
<index>new_column</index>
<type>text</type>
</arguments>
</action>
</reference>
</sales_order_grid_update>
<adminhtml_sales_order_grid>
<update handle="sales_order_grid_update" />
</adminhtml_sales_order_grid>
<adminhtml_sales_order_index>
<update handle="sales_order_grid_update" />
</adminhtml_sales_order_index>
</layout>
Is it possible to remove one of the default columns of the sales order grid with a layout update? If so, is this the right XML for it? I know I can remove that column with an observer or by rewriting the appropriate block class, but I'd like to see if an layout update can achieve the same while being as minimally intrusive as possible.
This is the approach I'm taking: http://www.atwix.com/magento/column-to-orders-grid/.