pranab
pranab

Reputation: 155

how to show select name instead of value in magento grid

I want to show marketplace dropdown name in magento grid but what i write in my code that display marketplace value.Bellow is my code

 protected function _prepareColumns()
    {
    $this->addColumn('marketplace', array(
    'header'    => Mage::helper('adminhtml')->__('Marketplace'),
    'align'     =>'right',
    'width'     => '10px',
    'index'     => 'marketplace',
    ));
    $this->addColumn('action',
    array(
    'header'    => Mage::helper('adminhtml')->__('Action'),
    'width'     => '100px',
    'type'      => 'action',
    'getter'    => 'getId',
    'actions'   => array(array(
    'caption' => Mage::helper('adminhtml')->__('Edit'),
    'url'     => array('base' => '*/*/edit'),
    'field'   => 'id'
    )),
    'filter'    => false,
    'sortable'  => false,
    'index'     => 'id',
    ));
    return parent::_prepareColumns();
    }

could anyone please point out what i am doing wrong as i do not have much experience in magento.

Thanking you all in advance

Upvotes: 1

Views: 746

Answers (1)

Pronay Santra
Pronay Santra

Reputation: 26

add field type for market place like...

$this->addColumn('marketplace', array(
'header'    => Mage::helper('adminhtml')->__('Marketplace'),
'align'     =>'right',
'width'     => '10px',
'index'     => 'marketplace'
'type'    => 'options',
'options'   => array(
                6 => '6',
                5 => '4',
                4 => '4',
                3 => '3',
                2 => '2',
                1 => '1'
            ),
));

Upvotes: 1

Related Questions