Supial
4 Jan 2012, 7:24 AM
Greetings,
I'm migrating my application from 3.4 to 4.0 and I've extended some of the core input fields. In 3.4, I was able to handle changes in form fields (ex: TextField) using the "valid" event. This event doesn't seem to exist in 4.0 and I'm wondering if there is a counterpart for this event? I need to be able to interact with the component only when the field is/has been validated. I don't want to use the "change" or "blur" events, since these events fire irregardless if the value in the field is valid.
For example:
3.4:
my.TextField = Ext.extend(Ext.form.TextField,{
binding: '',
readOnly: false,
initComponent: function(){
var config = {
width: 200,
readOnly: this.readOnly
};
Ext.apply(this, Ext.apply(this.initialConfig, config));
my.TextField.superclass.initComponent.apply(this, arguments);
},
onRender: function(ct, position){
my.TextField.superclass.onRender.call(this, ct, position);
this.on('valid', function(field) {
var bind = document.getElementById(field.binding);
if (bind != null) {
bind.value = field.getValue();
}
});
}
});
Cheers,
Marcel
I'm migrating my application from 3.4 to 4.0 and I've extended some of the core input fields. In 3.4, I was able to handle changes in form fields (ex: TextField) using the "valid" event. This event doesn't seem to exist in 4.0 and I'm wondering if there is a counterpart for this event? I need to be able to interact with the component only when the field is/has been validated. I don't want to use the "change" or "blur" events, since these events fire irregardless if the value in the field is valid.
For example:
3.4:
my.TextField = Ext.extend(Ext.form.TextField,{
binding: '',
readOnly: false,
initComponent: function(){
var config = {
width: 200,
readOnly: this.readOnly
};
Ext.apply(this, Ext.apply(this.initialConfig, config));
my.TextField.superclass.initComponent.apply(this, arguments);
},
onRender: function(ct, position){
my.TextField.superclass.onRender.call(this, ct, position);
this.on('valid', function(field) {
var bind = document.getElementById(field.binding);
if (bind != null) {
bind.value = field.getValue();
}
});
}
});
Cheers,
Marcel