When I reset a form in Ext.js it resets every child component, but the only events fired are invalid
and valid
. It seems a bit "hacky" to hook them to handle the clearing of a value, is there no other way?
The "problem domain" is that I am writing a plugin to create dependent comboboxes:
Ext.plugins.combobox.DependsOn = function(dependsOn) {
function init() {
var cb = this,
parent = Ext.getCmp(dependsOn);
parent.on("disable", function() {
cb.clearValue();
cb.disable();
});
parent.on("select", function() {
cb.disable(); // dependents will be disabled
cb.clearValue();
cb.getStore().load();
cb.enable();
});
}
return {
init: function(cb) {
cb.afterRender = cb.afterRender.createSequence(init);
}
}
};
This works well until I call form.reset()
at which point the comboboxes remain enabled but empty. I'd like to be able to hook some reset
event and there disable and enable my top component to cascade a disabled state downwards. Alas, it seems impossible but I hope someone has a smart answer.
Thank you.