Hello,
I would like to add {enableKeyEvent:true} to a Textarea during runtime, because it is not available by Designer's Component Config (yet ?).
That leads me to the general question how to do this and similar actions with arbitrary components.
1. I could insert the config params into MyContainer.ui.js - but it will be overwritten every time I export it.
2. I tried it successfully whith th following code in MyContainer.js:
Code:
MyContainer = Ext.extend(MyContainerUi, {
initComponent: function() {
MyContainer.superclass.initComponent.call(this);
MyFieldUi = Ext.override(Ext.form.TextArea, {
enableKeyEvents: true,
initComponent: function() {
MyFieldUi.superclass.initComponent.call(this);
}
});
this.textfld.on('keypress', this.onkeypress, this);
},
onkeypress: function(fld, e) {
var k = e.getKey();
alert("You just presssed "+k+", but why?");
}
});
However, this will affect the whole class, I think, but not only the particular object instance.
Please help me to figure out how to get it.
Thanks in advance