Extjs Plugins |best| «FRESH • Tips»
updateButtonVisibility: function(field, newVal) this.clearBtn.setVisible(!Ext.isEmpty(newVal));
1. What is an ExtJS Plugin? In ExtJS, a Plugin is a class that encapsulates reusable functionality, which can be dynamically added to a component (like a Grid, Form, or Panel) at runtime or design time. Unlike a component's subclass (e.g., Ext.grid.Panel ), a plugin does not inherit from the host component. Instead, it "plugs into" the component's lifecycle and event system to augment its behavior. extjs plugins
init: function(host) this.host = host; // Add event listeners if (this.getLogEvents()) host.on( afterrender: this.onHostRender, destroy: this.onHostDestroy, scope: this ); , updateButtonVisibility: function(field, newVal) this
init: function(host) console.log('Plugin init on', host.$className); this.host = host; // ... rest scope: this )