• 后台gird表单按钮操作


    1.$this->_removeButton('reset');#########################################删除重置这个按钮。
    2.$this->_addButton("new",array(######################按钮的添加
         'label'     => Mage::helper('new')->__('继续添加'),############ 按钮的名称
         'onclick'   => "confirmSetLocation('AAA', '{$this->getUrl('*/*/cancel')}')",//这里是在跳转之前跳出一个对话框
         'onclick'   => "setLocation('{$this->getUrl('*/*/new')}')",//直接跳转到你想到的功能动作(这里的new是方法Action)
         'class'   => 'save'
                ));
    案例:
       if(!!$batch && !!$batch->getId()){
              // 有管理员权限可以删除
              if(!Mage::getSingleton('admin/session')->isAllowed('warehouse/manage_admin')){
               $this->_removeButton('delete');
              }
             
           $this->_addButton('entry', array(
               'label'    => Mage::helper('warehouse')->__('入库'),
               'onclick'  => "setLocation('{$this->getUrl('*/*/recordEntry', array('id' =>$batch->getId()))}')",
               'class'    => 'save'
           ));
           $this->_addButton('delivery', array(
               'label'    => Mage::helper('warehouse')->__('发货'),
               'onclick'  => "setLocation('{$this->getUrl('*/*/recordDelivery', array('id' =>$batch->getId()))}')",
               'class'    => 'save'
           ));
           $this->_addButton('reissue', array(
               'label'    => Mage::helper('warehouse')->__('补货'),
               'onclick'  => "setLocation('{$this->getUrl('*/*/recordReissue', array('id' =>$batch->getId()))}')",
               'class'    => 'save'
           ));
           $this->_addButton('return', array(
               'label'    => Mage::helper('warehouse')->__('退货'),
               'onclick'  => "setLocation('{$this->getUrl('*/*/recordReturn', array('id' => $batch->getId()))}')",
               'class'    => 'save'
           ));
           $this->_addButton('adjustment', array(
               'label'    => Mage::helper('warehouse')->__('调整'),
               'onclick'  => "setLocation('{$this->getUrl('*/*/recordAdjustment', array('id' =>$batch->getId()))}')",
               'class'    => 'save'
           ));
           $this->_addButton('record_grid', array(
               'label'    => Mage::helper('warehouse')->__('操作列表'),
               'onclick'  => "setLocation('{$this->getUrl('warehouse_adminhtml/record/index',//另一个控制器                      

        array('batch_id' => $batch->getId()))}')",
               'class'    => 'save'
           ));
            }

  • 相关阅读:
    【问题记录】ajax dataType属性
    【问题记录】springMVC @Valid使用不生效问题
    Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/jms/JMSContext
    mysql优化:explain 和 profile
    【问题记录】mysql TIMEDIFF 和 TIMESTAMPDIFF的使用
    初次搭建spring boot 项目(实验楼-学习笔记)
    JqGrid自定义toolbar
    MS SQL SERVER 2008 R2 实例服务启动出现10048错误解决办法
    C#快速导入海量XML数据至SQL Server数据库
    SQL2012之FileTable与C#的联合应用
  • 原文地址:https://www.cnblogs.com/sqsnbrdcwlcfzj/p/6221044.html
Copyright © 2020-2023  润新知