我创建了一个Magento Admin Grid并使用Mass Action来设置开始和结束日期。
现在,我的群众行动按照dropdown list
中的选择运行,选择开始或停止datepicker
框将在选择第一个框后显示。
我可以在dropdown list
之前同时显示两个方框(datepicker
和select date
)或dropdown list
吗?
我的代码:
$this->getMassactionBlock()->addItem('setstartdate', array(
'label' => $this->__('Set Start Date'),
'url' => $this->getUrl('*/*/massSetstartdate', array('' => '')),
'confirm' => $this->__('Are you sure?'),
'additional' => array(
'setstartdate' => array(
'name' => 'setstartdate',
'time' => true,
'input' => 'datetime',
'type' => 'datetime',
'class' => 'required-entry',
'label' => Mage::helper('setcustomdate')->__('Set start Date'),
// 'gmtoffset' => true,
'image' => '/skin/adminhtml/default/default/images/grid-cal.gif',
'format' => 'yyyy-MM-dd H:mm:ss'
)
)
));
$this->getMassactionBlock()->addItem('setstopdate', array(
'label' => $this->__('Set Stop Date'),
'url' => $this->getUrl('*/*/massSetstopdate', array('' => '')),
'confirm' => $this->__('Are you sure?'),
'additional' => array(
'setstopdate' => array(
'name' => 'setstopdate',
'time' => true,
'input' => 'datetime',
'type' => 'datetime',
'class' => 'required-entry',
'label' => Mage::helper('setcustomdate')->__('Set Stop Date'),
// 'gmtoffset' => true,
'image' => '/skin/adminhtml/default/default/images/grid-cal.gif',
'format' => 'yyyy-MM-dd H:mm:ss'
)
)
));
修改1 更新prepareColumns
protected function _prepareColumns() {
$helper = Mage::helper('setupdate');
$this->addColumn('data_id', array(
'header' => $helper->__('Data No.'),
'index' => 'data_id'
));
$this->addColumn('startdate', array(
'header'=> $helper->__('Start'),// store
'index' => 'startdate',
'filter_index' => 't1.start_date',
'format' => 'F',
'type' => 'datetime',
));
$this->addColumn('stopdate', array(
'header'=> $helper->__('Stop'),// store
'index' => 'stopdate',
'filter_index' => 't1.stop_date',
'format' => 'F',
'type' => 'datetime',
));
return parent::_prepareColumns();
}