如何在Mgento的类别产品网格中添加创建AdditionalActionBlockHtml到批量操作?

如何将AdditionalActionBlockHtml添加到类别产品网格中的批量操作中?如何在Mgento的类别产品网格中添加创建AdditionalActionBlockHtml到批量操作?

这样的状态 我在app /设计/ adminhtml /默认/缺省的/模板/空间/格/ massaction.phtml 成立getAdditionalActionBlockHtml但我不明白它是如何工作的。

 <div class="right"> 

<div class="entry-edit">

<?php if ($this->getHideFormElement() !== true):?>

<form action="" id="<?php echo $this->getHtmlId() ?>-form" method="post">

<?php endif ?>

<?php echo $this->getBlockHtml('formkey')?>

<fieldset>

<span class="field-row">

<label><?php echo $this->__('Actions') ?></label>

<select id="<?php echo $this->getHtmlId() ?>-select" class="required-entry select absolute-advice local-validation">

<option value=""></option>

<?php foreach($this->getItems() as $_item): ?>

<option value="<?php echo $_item->getId() ?>"<?php echo ($_item->getSelected() ? ' selected="selected"' : '')?>><?php echo $_item->getLabel() ?></option>

<?php endforeach; ?>

</select>

</span>

<span class="outer-span" id="<?php echo $this->getHtmlId() ?>-form-hiddens"></span>

<span class="outer-span" id="<?php echo $this->getHtmlId() ?>-form-additional"></span>

<span class="field-row">

<?php echo $this->getApplyButtonHtml() ?>

</span>

</fieldset>

<?php if ($this->getHideFormElement() !== true):?>

</form>

<?php endif ?>

</div>

<div class="no-display">

<?php foreach($this->getItems() as $_item): ?>

<div id="<?php echo $this->getHtmlId() ?>-item-<?php echo $_item->getId() ?>-block">

<?php echo $_item->getAdditionalActionBlockHtml() ?>

</div>

<?php endforeach; ?>

</div>

</div>

回答:

我决定通过这个加入massactions方法

public function addMassAction($observer) 

{

$block = $observer->getEvent()->getBlock();

if(get_class($block) =='Mage_Adminhtml_Block_Widget_Grid_Massaction' && $block->getRequest()->getControllerName() == 'catalog_product')

{

$stores = Mage::getSingleton('adminhtml/system_config_source_store')->toOptionArray();

$block->addItem('export', array(

'label' => Mage::helper("prodestransl")->__("Export"),

'url' => Mage::helper('adminhtml')->getUrl('prod/adminhtml_export/run'),

'additional' => array(

'stores' => array(

'name' => 'stores',

'type' => 'select',

'class' => 'required-entry',

'label' => Mage::helper('catalog')->__('Stores'),

'values' => $stores

)

)

));

}

}

以上是 如何在Mgento的类别产品网格中添加创建AdditionalActionBlockHtml到批量操作? 的全部内容, 来源链接: utcz.com/qa/258267.html

回到顶部