Magento grids are very useful for displaying/filtering and sorting data. Their flexibility is endless, you can customize them in any way. One may want to add a new radio button or checkbox column for rapid marking. Here is how you can add custom checkbox or radio button column in Magento admin grid. Radio button: Checkbox: Further, in Form.php you can add this below code to have by default behavior and onclick behaviour:
$this->addColumn('some_id', array( 'header_css_class' => 'a-center', 'header' => Mage::helper('adminhtml')->__('Some Header'), 'type' => 'radio', 'html_name' => 'items[]', 'align' => 'center', 'value' => array('1') )); $this->addColumn('some_id', array( 'header_css_class' => 'a-center', 'header' => Mage::helper('configurator')->__('Some Header'), 'index' => 'some_id', 'type' => 'checkbox', 'align' => 'center', 'values' => array('1', '2') )); $fieldset->addField('some_id', 'checkbox', array( 'label' => Mage::helper('magentostudy_news')->__('Featured'), 'name' => 'featured', 'value' => 1, 'checked' => ($model->getFeatured() == 1) ? 'true' : '', 'onclick' => 'this.value = this.checked ? 1 : 0;', 'disabled' => false, 'readonly' => false, ));
Magento Admin Grid: Add Radio/Checkbox Column
Magento grids are very useful for displaying/filtering and sorting data. Their flexibility is endless, you can customize them in any way. One may want to add a
Related posts
Magento
Set Magento store's base link URL programmatically
Learn how to set Magento’s base link URL programmatically using the setup installer. This guide explains base_link_url vs. base_url, store-specific configuration, secure and unsecure URLs, common errors, troubleshooting, and best practices for managing Magento URL settings.
Magento
Set Magento Template, Skin & Layout
[code language=”php”] $groups[‘theme’][‘fields’][‘template’][‘value’] = ‘template_name’;
Magento
Magento get store by storecode
Learn how to efficiently retrieve a Magento 1 store by its unique store code without unnecessary loops. This guide explains how to use Magento’s built-in Mage::app()->getStore() method, handle invalid store codes safely, and improve code performance and memory efficiency in multi-store environments.