Ext.form.TextArea
Ext.ns('MyOwnForm');
MyOwnForm.TextArea = Ext.extend(Ext.form.TextArea , {
initComponent : function(){
this.addEvents(
'dblclick',
'contextmenu'
);
MyOwnForm.TextArea.superclass.initComponent.apply(this,arguments);
},
onRender : function(){
MyOwnForm.TextArea.superclass.onRender.apply(this,arguments);
this.el.on("dblclick" , this.onDblClick , this);
this.el.on("contextmenu" , this.onContextmenu , this);
},
onDblClick : function(){
this.fireEvent("dblclick" , this);
},
onContextmenu : function(e){
e.stopEvent();
this.fireEvent("contextmenu" , this);
}
});
Ext.reg('_ta' , MyOwnForm.TextArea);
var _form = new Ext.form.FormPanel({
frame : true,
renderTo : Ext.getBody(),
width : 300,
height : 200,
items : [{
xtype : "_ta",
fieldLabel : "details",
listeners : {
"contextmenu" : function(){
alert(123);
},
"dblclick" : function(){
alert(456);
}
}
}]
});
这个是自己扩展
来源:一起Ext
原文地址:http://www.17ext.com/showtopic-5878.aspx

浙公网安备 33010602011771号