0

I have admin form with grid. in my grid i have set checkbox as another form field but it gives disabled when it rendered.My code is as below.

Layout file.

<shippinggroup_adminhtml_shippinggroup_customers>
 <block type="core/text_list" name="root" output="toHtml">
 <block type="shippinggroup/adminhtml_shippinggroup_edit_tab_formcustomer" name="shippinggroup.edit.tab.formcustomer" />
 <block type="adminhtml/widget_grid_serializer" name="customer_grid_serializer" >
 <action method="initSerializerBlock">
 <grid_block_name>shippinggroup.edit.tab.formcustomer</grid_block_name>
 <data_callback>getSelectedCustomers</data_callback>
 <hidden_input_name>links[customer_ids]</hidden_input_name>
 <reload_param_name>customer</reload_param_name>
 </action>
 <action method="addColumnInputName">
 <input_name>warrantymail</input_name>
 </action>
 </block>
 </block>
</shippinggroup_adminhtml_shippinggroup_customers>

grid column.

$this->addColumn('customer_ids', array(
 'header_css_class' => 'a-center',
 'type' => 'checkbox',
 'name' => 'customer_ids',
 'values' => $this->_getSelectedCustomers(),
 'align' => 'center',
 'index' => 'entity_id'
 ));
 $this->addColumn('position', array(
 'header' => Mage::helper('catalog')->__('Position'),
 'name' => 'position',
 'type' => 'checkbox',
 'validate_class' => 'validate-number',
 'index' => 'position',
 'values' => '',
 ));

Here is screenshot of output https://www.screencast.com/t/xCqsQ6NCF

I would also like to display label for column.

Please guide me on this.

asked Feb 13, 2017 at 6:04

1 Answer 1

0

your data_callback is getSelectedCustomers

<data_callback>getSelectedCustomers</data_callback>

and you are calling

'values' => $this->_getSelectedCustomers(),

change it to

'values' => $this->getSelectedCustomers(),
answered Feb 13, 2017 at 6:21
10
  • that is not the main point.i have two checkbox in one grid i want it work separately and post in form.currently it render disable when edit record.when i checked on first checkbox it also check all the second column checkbox too. Commented Feb 13, 2017 at 6:34
  • @MageLerner you want to get post values of this gird? on based on that add some column? Commented Feb 13, 2017 at 6:40
  • yes exactly i would like it work seperately both checkbox and post Commented Feb 13, 2017 at 6:42
  • @MageLerner you can get grid values simply use this code $this->getRequest()->getPost('customer') Commented Feb 13, 2017 at 6:46
  • yes i can but second checkbox is not working correctly dear Commented Feb 13, 2017 at 6:55

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.