我已经写了一个自定义模块,Magento的后台,我想添加过滤器为每一列如何添加列过滤器为每列在Magento网格自定义模块
任何人都可以点我在正确的方向至于在哪里处理这个函数的代码?我将假设其控制器的一部分
感谢您提供任何帮助!
我都用这个术语的编制列这样
public function __construct()
{
parent::__construct();
$this->setId('main_grid');
$this->setDefaultSort('entity_id');
$this->setDefaultDir('DESC');
$this->setSaveParametersInSession(true);
$this->setUseAjax(true);
}
protected function _prepareCollection()
{
$model = Mage::getModel('CartAbandoned/tip');
$collection = $model->getCollection();
$this->setCollection($collection);
return parent::_prepareCollection();
}
$this->addColumn('id', array(
'header' => Mage::helper('CartAbandoned')->__('Id'),
'align' => 'right',
'width' => '50px',
'type' => 'number',
'index' => 'entity_id',
));
$this->addColumn('E-Mail', array(
'header' => Mage::helper('CartAbandoned')->__('EMail'),
'align' => 'left',
'width' => '150px',
'index' => 'customer_email',
'type' => 'text',
'truncate' => 50,
'escape' => true,
));
$this->addColumn('firstName', array(
'header' => Mage::helper('CartAbandoned')->__('firstName'),
'align' => 'left',
'index' => 'customer_firstname',
'type' => 'text',
'escape' => true,
));
$this->addColumn('lastName', array(
'header' => Mage::helper('CartAbandoned')->__('lastName'),
'align' => 'left',
'index' => 'customer_lastname',
'type' => 'text',
'escape' => true,
));
$this->addColumn('total', array(
'header' => Mage::helper('CartAbandoned')->__('Total'),
'align' => 'left',
'index' => 'base_grand_total',
'type' => 'price',
'escape' => true,
));
$this->addColumn('quan', array(
'header' => Mage::helper('CartAbandoned')->__('Quantity'),
'align' => 'left',
'index' => 'items_qty',
'type' => 'number',
'escape' => true,
));
$this->addColumn('cartcreatedtime', array(
'header' => Mage::helper('CartAbandoned')->__('cartcreatedtime'),
'align' => 'left',
'index' => 'created_at',
'type' => 'datetime',
'escape' => true,
));
$this->addColumn('cartabandonedtime', array(
'header' => Mage::helper('CartAbandoned')->__('cartabandonedtime'),
'align' => 'left',
'index' => 'updated_at',
'type' => 'datetime',
'escape' => true,
));
$this->addColumn('action',array(
'header' => Mage::helper('CartAbandoned')->__('Action'),
'type' => 'action',
'getter' => 'getId',
'actions' => array(
array(
'caption' => Mage::helper('CartAbandoned')->__('View Products'),
'url' => array('base'=>'*/*/edit'),
'field' => 'id'
)
),
'filter' => false,
'sortable' => false
));
请澄清你的问题。你问在哪里把这段代码?如果不是,请更具体地说明您想要找到的内容。 – shaune
你正在学习一个教程来指导你吗?如果不是,为什么不呢? – clockworkgeek