日期:2014-05-16  浏览次数:20373 次

extjs的formpanel定制右键菜单

var form=new Ext.form.FormPanel({
???????? labelAlign:'right',
??????? id:'topFormId',
?????? labelWidth:60,
??????? title:'基本信息',
??????? frame:true,
??????? width:lh.screenAvailWidth,
??????? items:[{
??????????? layout:'column',
??????????? items:[{
??????????????? columnWidth:0.04,
??????????????? layout:'form',
??????????????? items:[{xtype:'box',autoEl:{//显示从莞的图片
??????????????????? tag:'div',
??????????????????? children:[{
??????????????????????? tag:'img',
??????????????????????? qtip:'从莞高速公路投资有限公司图标',
??????????????????????? src:'images/congGuan.jpg',
??????????????????????? height:50,
??????????????????????? width:50
??????????????????? }]
??????????????? }}
??????????????? ]
??????????? },{
???????????????? columnWidth:0.20,
???????????????? layout:'form',
??????????????? items:[{xtype:'box',id:'testId',html:'<h1 style="font-size:15pt">从莞高速公路惠州段<br/>项目建设管理平台(PMP)</h1>',boxMinWidth:150}]
??????????? },{
??????????????? columnWidth:0.76,
??????????????? layout:'form',
??????????????? id:'topmenu',
??????????????? items:[tb]
??????????? }]
??????? }],
??????? listeners:{
??????????? render:function(p){
??????????????? p.getEl().on("click",function(e){//单击事件
?????????????????? alert('onclick');
??????????????? });
??????????????? p.getEl().on("contextmenu",function(e){//右键事件
?????????????????????? e.preventDefault();
?????????????????????? contextmenu.showAt(e.getXY());
??????????????? })
??????????? }
??????? }
??? });