Extjs右键菜單

//右擊菜單




var grid = new xg.GridPanel({

        store: store,

        height:600,

        minHeight:400,

        width:1200,

        minWidth:600,

        clicksToEdit:1,

        id:'main_grid',

        forceFit: true,

        scrollOffset: 0,

        cm:cm,

        sm:new Ext.grid.RowSelectionModel({singleSelect:true}),

         bbar:new Ext.PagingToolbar({

           pageSize:15,

           id:'pagetools',

           displayInfo:true,

           store:store,

           displayMsg:'顯示第 {0} 條到 {1} 條記錄 總共{2}條記錄',

           emptyMsg:'請輸入查詢的記錄'

        }),

        renderTo: document.body

    });




var contextmenu=new Ext.menu.Menu({

      id:'theContextMenu',

      items:[{

              text:'查看',

              handler:function(){

                Ext.getCmp('add').setVisible(false);

                Ext.getCmp('mod').setVisible(false);

                Ext.getCmp('baocun').setVisible(false);

                pa_mod();

                var pa_no=encodeURIComponent(Ext.encode(Ext.getCmp('pa_no').getValue()));

                pa_data_store.removeAll();

                pa_data_store.baseParams={pa_no:pa_no,caigou_search:'ALL',pmat_id_search:''};

                pa_data_store.reload({params:{start:0,limit:50}});

                win_mingxi.show();

              }

              },{

              text:'新增',

              id:'add_right',

              hidden:true,

              handler:function(){

                add_pa();

              }

              },{

              text:'修改',

              id:'mod_right',

              hidden:true,

              handler:function(){

                pa_mod();

                Ext.getCmp('baocun').setVisible(true);

                var pa_no=encodeURIComponent(Ext.encode(Ext.getCmp('pa_no').getValue()));

                pa_data_store.removeAll();

                pa_data_store.baseParams={pa_no:pa_no,caigou_search:'ALL',pmat_id_search:''};

                pa_data_store.reload({params:{start:0,limit:50}});

                win_mingxi.show();

              }

              },{

              text:'取消審核',

              hidden:true,

              id:'quxiao_audit',

              handler:function(){

                  quxiao();

              }

      },{

              text:'打印',

              id:'print2',

              handler:function(){

                  print_pa();

              }

      }]

});

grid.on('rowcontextmenu',function(grid,rowIndex,e){

        e.preventDefault();

        grid.getSelectionModel().selectRow(rowIndex);

        contextmenu.showAt(e.getXY());

});

grid.on('contextmenu',function(e){

        e.preventDefault();

});

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值