我创建了一个模块,列出了可在 adminhtml 的网格中进行审核的订单。
我需要将 orderId 从网格视图传递到详细视图,但我不知道该怎么做。
这是我的Grid.php
{
public function __construct() {
parent::__construct();
$this->setId('moderationGrid');
// This is the primary key of the database
$this->setDefaultSort('increment_id');
$this->setDefaultDir('ASC');
$this->setSaveParametersInSession(true);
}
protected function _prepareCollection() {
$collection = Mage::getModel('sales/order')->getCollection();
$this->setCollection($collection);
return parent::_prepareCollection();
}
protected function _prepareColumns() {
$this->addColumn('increment_id', array(
'header' => Mage::helper('sales')->__('Order Number'),
'align' =>'center',
'index' => 'increment_id',
));
$this->addColumn('created_at', array(
'header' => Mage::helper('sales')->__('Purchase Date'),
'align' => 'center',
'index' => 'created_at',
'type' => 'datetime',
));
$this->addColumn('action', array(
'header' => Mage::helper('moderation')->__('Action'),
'align' => 'center',
'type' => 'action',
'getter' => 'getId',
'actions' => array(
array(
'caption' => Mage::helper('sales')->__('Review'),
'url' => array('base'=>'*/adminhtml_moderation/view'),
'field' => 'increment_id'
)
),
'filter' => false,
'sortable' => false,
'index' => 'stores',
'is_system' => true,
));
return parent::_prepareColumns();
}
这是我的看法Form.php
class Moderation_Block_Adminhtml_Moderation_View_Form extends Mage_Adminhtml_Block_Widget_Form
{
protected function _construct()
{
parent::_construct();
$this->setTemplate('moderation/form.phtml');
}
public function getOrder()
{
$moderationId = $this->getRequest()->getParam('increment_id');
$order = Mage::getModel('sales/order')->load();
}
}