2
votes

I am working on a custom module in magento admin that uses the ‘sales/order_grid_collection’ class to show the grid of all orders. The grid appears fine.

However, the first column of the grid is of ‘increment_id’, unlike the actual orders grid where the first column has checkboxes for mass action. I am getting this in spite having copy-pasted almost all the code for the _prepareColumns method from the original order module.

So I tried adding a first column of checkboxes manually inside the _prepareColumns method as follows

$this->addColumn('order_id', array(
         'header_css_class' => 'a-center',
         'header'    => Mage::helper('sales')->__('Assigned'),
         'type'      => 'checkbox',
         'width' => '20px',
         'field_name' => 'orders[]',
         'align'     => 'center',    
         'renderer' => new Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Checkbox(),
         'index' => 'order_id'           
));

Upon doing this, the chekboxes do appear but they are disabled.

What am I missing here ?

Thanks

1

1 Answers

1
votes

What shows up the checkboxes for mass action is the _prepareMassaction() method (see for example Mage_Adminhtml_Block_Sales_Order_Grid line 151-199 on v1.5), do you copy-pasted also in your Namespace_Module_Block_Adminhtml_Yourpath_Grid class? If so, please paste it here to see if there is something wrong about it