我想在magento网格中显示市场下拉名称,但我在代码中写下了显示市场价值的内容。我的代码是
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();
}
任何人都可以指出我做错了什么,因为我没有太多的magento经验。
提前感谢你们
答案 0 :(得分:1)
为市场添加字段类型,如...
$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'
),
));