javascript - Is there really no way to hook into the reset event of an Ext.js component? -


when reset form in ext.js resets every child component, events fired invalid , valid. seems bit "hacky" hook them handle clearing of value, there no other way? "problem domain" writing plugin 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 disabled             cb.clearvalue();              cb.getstore().load();             cb.enable();         });      }     return {         init: function(cb) {             cb.afterrender = cb.afterrender.createsequence(init);         }     } }; 

this works until call form.reset() @ point comboboxes remain enabled empty. i'd able hook reset event , there disable , enable top component cascade disabled state downwards. alas, seems impossible hope has smart answer.

thank you.

assuming "parent" ext.form.field, use createsequence on parent.reset.

parent.reset = parent.reset.createsequence(function(){     //here, have done parent.on('reset', ...) }); 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -