zoukankan      html  css  js  c++  java
  • 后台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'
           ));
            }

  • 相关阅读:
    wpf之ComboBox绑定
    初始WPF
    WinForm 中 comboBox控件之数据绑定
    C# 操作注册表
    VS创建Web项目的两种形式WebSite和WebApplicationd的区别!
    网页加载慢的问题及部分解决办法
    获取CPU序列号
    53种使网页增速的方法、工具和资源
    Server Application Error报错解决方案
    20个使Web开发更高效的工具列表
  • 原文地址:https://www.cnblogs.com/sqsnbrdcwlcfzj/p/6221044.html
Copyright © 2011-2022 走看看