What is a plugin?
An Ext JS plugin is a class that is used to provide additional functionalities to an existing component. Plugins must implement a method named init
, which is called by the component and is passed as the parameter at the initialization time, at the beginning of the component's lifecycle. The destroy
method is invoked by the owning component of the plugin, at the time of the component's destruction. We don't need to instantiate a plugin class. Plugins are inserted in to a component using the plugin's configuration option for that component.
Plugins are used not only by components to which they are attached, but also by all the subclasses derived from that component. We can also use multiple plugins in a single component, but we need to be aware that using multiple plugins in a single component should not let the plugins conflict with each other.