Magento:将自定义字段添加到网格并填充它
我遵循了本教程:并在我的数据库中添加了自定义字段 我想在Sales->Invoices网格中显示该字段的值 我使用以下代码添加了该列:Magento:将自定义字段添加到网格并填充它,magento,Magento,我遵循了本教程:并在我的数据库中添加了自定义字段 我想在Sales->Invoices网格中显示该字段的值 我使用以下代码添加了该列: $this->addColumn('govt_id', array( 'header'=> $this->__('Govt Id'), 'align' =>'right', 'type=' => 'text', 'inde
$this->addColumn('govt_id',
array(
'header'=> $this->__('Govt Id'),
'align' =>'right',
'type=' => 'text',
'index' => 'govt_id',
));
我的问题是如何用自定义添加字段中的数据填充它
protected function _getCollectionClass()
{
return 'sales/order_invoice_grid_collection';
}
protected function _prepareCollection()
{
$collection = Mage::getResourceModel($this->_getCollectionClass());
// $collection->getSelect()->joinLeft(???);
$this->setCollection($collection);
return parent::_prepareCollection();
}
问候