如何将“保存并继续编辑”按钮添加到我的表单



我正在开发一个新的Magento扩展,在我的Adminhtml表单中,我想添加"saveAndContinueEdit"按钮

我已将此代码添加到我的 Edit.php 文件中。

      $this->_addButton('saveandcontinue', array(
    'label'     => Mage::helper('adminhtml')->__('Save And Continue Edit'),
    'onclick'   => 'saveAndContinueEdit()',
    'class'     => 'save',
), -100);

但是当我点击它时,我有这个JavaScript错误:

错误:

引用错误:未定义保存和继续编辑 Fichier 源: http://X.X.X.X/magento/index.php/slider/adminhtml_config/new/key

你可以帮我吗?
谢谢

在你的

管理块构造函数中 把这些行放进去。

$this->_formScripts[] = " function saveAndContinueEdit(){
            editForm.submit($('edit_form').action+'back/edit/');
        }
    ";

请记住,您还必须在PHP中为其编写功能。现在在你的行动中,只需进行最后的检查,如果你要回到参数..将其重定向到引用页面。

最新更新