Reputation: 1014
I am creating a new custom product grid which will show a custom yes/no attribute.
I have successfully displayed the value of yes no which is saved in database in 0,1 format.
But I need yes or no to be shown in data field.
I have used below code in my Grid.php
Please help guys.
Upvotes: 2
Views: 9210
Reputation: 193
Try use
$this->addColumn('yes/no', array(
...
'type' => 'options',
'options' => Mage::getSingleton('adminhtml/system_config_source_yesno')->toArray(),
...
));
Upvotes: 8
Reputation: 1014
Solved it.
here is code to show yes/no input type attribute in product grid.
$this->addColumn('yesno',
array(
'header'=> Mage::helper('catalog')->__('yesno'),
'width' => '50px',
'align' => 'right',
'index' => 'yesno',
'type'=>'options',
'options' => array('1' => 'Yes', '0' => 'No')
));
Sorry for images instead of code.
Upvotes: 10