extjs右键功能

大致代码如下
initListener : function(){
			/*this.addListener("render",function(){
			 	  this.loadMask=new Ext.LoadMask(Ext.getBody(),{msg:'正在载入数据,请稍候...'}); 
			 	  this.loadMask.show();
		          this.store.load({params:{start:0,limit:35}});
			},this);*/
          //双击事件监听
			this.addListener("rowdblclick",this.doModify,this);
//右键功能监听			this.addListener("rowcontextmenu",this.onRowContextmenu,this);
		},


onRowContextmenu : function(grid, rowIndex, e) {
//获取哪一行
			this.getSelectionModel().selectRow(rowIndex);
			e.preventDefault();//屏蔽鼠标右键
//显示右键菜单
			this.rightMenu.showAt(e.getXY());
		},



右键菜单
initRightMenu : function(){
			var menuItems = [];
			menuItems.push({
				text : '修改',
				iconCls : 'update',
				handler :this.doModify,
				scope : this
			},'-',{
				text : '删除',
				iconCls : 'delete',
				handler :this.doDelete,
				scope : this
			},'-',{
				 text: '详细信息', 
				 iconCls:'refresh',
				 handler:this.doDetail,
				 scope : this
			});
			this.rightMenu = new Ext.menu.Menu({
				items : menuItems
			});
		},
 

你可能感兴趣的:(ExtJs)