I have an admin grid which shows up product details(like the one in Catalog/Manage Products) with the first column as radio type.
How to add onclick
event, which should call a js function with a parameter of dynamic value(such as value of radio button itself), and id
selector for the radio button, whose value should be a combination of static and dynamic value(such as column_id+radio_button_value).
The class which defines the column declaration is in the class which extends from Mage_Adminhtml_Block_Widget_Grid
and my column declarations are in the _prepareColumns
method, and the code for the first two columns in my grid has been declared as follows:
$this->addColumn('products_grid_radio',
array(
'header' => '',
'type' => 'radio',
'html_name' => 'products_grid_radio',
'value' => array('1'),
'align' =>'center',
//'id' => 'products_grid_radioproducts_grid_radio_value',
//'onclick' => 'setProduct(products_grid_radio_value);',
));
$this->addColumn('entity_id',
array(
'header'=> Mage::helper('catalog')->__('ID'),
'width' => '50px',
'type' => 'number',
'index' => 'entity_id',
));
What is the correct way to add onclick
event and id
selector to a column of radio type?
Many Thanks in Advance.