分享

Extjs4

 馆天下ccf 2014-09-05
  • listeners:{  
  •                 'itemcontextmenu':function(view,record,item,index,e,eOpts){  
  •                     //禁用浏览器的右键相应事件  
  •                     e.preventDefault();  
  •                     e.stopEvent();  
  •                       
  •                     var menu = new Ext.menu.Menu({  
  •                         //控制右键菜单位置  
  •                         float:true,  
  •                          items:[{  
  •                                 text:"修改",  
  •                                 iconCls:'leaf',  
  •                                 handler:function(){  
  •                                     //当点击时隐藏右键菜单  
  •                                     this.up("menu").hide();  
  •                                     alert(record.raw.name);  
  •                                 }  
  •                             },{  
  •                                 text:"添加",  
  •                                 iconCls:'leaf',  
  •                                 handler:function(){  
  •                                     this.up("menu").hide();  
  •                                     alert("添加");  
  •                                 }  
  •                             },{  
  •                                 text:"删除",  
  •                                 iconCls:'leaf',  
  •                                 handler:function(){  
  •                                     this.up("menu").hide();  
  •                                     alert("删除");  
  •                                 }  
  •                             }  
  •                          ]  
  •                     }).showAt(e.getXY());//让右键菜单跟随鼠标位置  
  •                 }  
  •             }  
    • 本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
      转藏 分享 献花(0

      0条评论

      发表

      请遵守用户 评论公约