开发者

Getting disabled checkboxes in Grid for a custom admin module in Magento

开发者 https://www.devze.com 2023-02-24 22:49 出处:网络
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.

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 o开发者_JS百科f ‘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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消