//右擊菜單
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();
});
Extjs右键菜單
最新推荐文章于 2023-01-06 15:34:00 发布