PDA

View Full Version : add multiple plugins or dynamically adding the plugins



gokulpotluri
15 May 2013, 4:24 AM
Hi All,

Using Extjs3.4

I am trying to add two plugins in a grid panel and code snipet goes on like this:

var grid = Ext.grid.GridPanel({
...
plugins : [plugin1, plugin2],
...
});

As it is giving error i tried to give one plugin as dynamic as below:


var grid = Ext.grid.GridPanel({
...
plugins : [plugin1],
...
});

grid.plugins.push(plugin2);
grid.doLayout();

Still it is not working out. Please help me regarding this one.

gokulpotluri
15 May 2013, 4:52 AM
Hi i got the solution for this. but on the dynamic way i got solution:

plugin2.init(grid);
grid.plugins.push(plugin2);

This is becasue first we have to initiate the plugin and then adding the plugin to grid.