How to display yes/no attribute in custom product grid in Magento?

Anurag Prashant picture Anurag Prashant · Aug 28, 2014 · Viewed 7.9k times · Source

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.

need to show yes/no value

But I need yes or no to be shown in data field.

I have used below code in my Grid.php

enter image description here

Please help guys.

Answer

Anurag Prashant picture Anurag Prashant · Aug 28, 2014

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.