View Full Version : Add plugin after grid has loaded

28 Sep 2010, 7:37 AM
Is there a way to add plugin for a grid after the grid has loaded in extjs? I have trouble where I use extjs designer tool to create a grid; however, there's no option in the designer tool where i can specify the plugin. I'd like to find a way to do it programmingly, anyone has any idea how would I do it? Thanks in advance.

28 Sep 2010, 11:37 AM
You can have a plugin that adds a listener to the afterrender event of the grid...


GridPlugin = function() {
return {
init: function(grid) {
'afterrender': function() {
//Do something
console.log('plugin exec');

//You must pass your plugin when instanciating the grid
new Ext.grid.GridPanel({
plugins: [
new GridPlugin()

1 Oct 2010, 4:30 PM
use this private method initPlugin().
It does not have in docs api.

myComponente.initPlugin(new myPlugin(), new myAnotherPlugin());

myComponente.initPlugin(new myPlugin({
config1: 'ExtJS',
config2: 'Brazilllllll'

1 Oct 2010, 5:16 PM
I think it is normally not a good idea to rely on private and undocumented functions since they might change in any further releases...