I have added a custom Tab grid to Form Section in my custom module, now I need to add some custom Column of checkbox type to my custom grid, which I added as per snapshot -
but all the custom Checkbox are coming disabled, I need these checkboxes enabled.
- 
 Please share the codeArunendra– Arunendra2016年05月30日 06:36:56 +00:00Commented May 30, 2016 at 6:36
1 Answer 1
Please consider the following things.
For example:
if your attribute is banner_gral Then in your controller saveAction() when saving the checkbox data do
$banner_gral = isset($your_form_Data['banner_gral']) ? 1 : 0;
For Grid and Form Page
In your controller you should have Mage::register(...)->getData() or Mage::register(...)
public function editAction()
 ....
 Mage::register('example_data', $model);
On your form _prepareForm()
$model = Mage::registry('example_data'); // NOTE registry('example_data'); NOT registry('example_data')->getData();
$fieldset->addField('entire_range', 'checkbox', array(
 ....
 'checked' => $model->getBannerGral()==1 ? 'true' : 'false',
 ......
))
On your grid _prepareColumns()
$this->addColumn('banner_gral', array(
 ....
 'type' => 'checkbox',
 'index' => 'banner_gral',
 'values' => array(1,2),
 'field_name' => 'checkbox_name',
 ....
));
- 
 Hi, not fully but some points in your answer has helped me, so +1Amit Dwivedi– Amit Dwivedi2016年06月03日 12:07:40 +00:00Commented Jun 3, 2016 at 12:07
- 
 Do you guys know how to do this exactly? because i'm on this situation and dont know how to do that, on catalog_category_product, they can checkbox checked, but i'm follow them and doesn't checked at all. @@ the values i put in is a array just like them did. Like this (1,2)fudu– fudu2018年08月11日 08:16:15 +00:00Commented Aug 11, 2018 at 8:16