-
16 Feb 2011 9:59 AM #1
Dynamically adding plugins to grid
Dynamically adding plugins to grid
Hi,
I have grid with plugins like this.
Assume that I have rendered the grid and loaded the store for the same.Code:var grd = new Ext.grid.GridPanel({ frame: true, minHeight: 200, plugins: [groupSummary,gridSummary,group], });
Now "after loading the grid", when I click on a button, or any event for that matter, I want to
a) remove all the plugins for the grid,
b) add new plugins and
c) refresh the gridView, "without reloading the store" for the grid.
Any ideas how to get this done?
Any advice is appreciated.
Thanks,
nandavanan
-
21 Feb 2011 6:23 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,170
- Vote Rating
- 32
Please post in the Ext Help section next time. Community Discussion is not the proper place.
Moving to Ext help.
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
21 Feb 2011 6:24 AM #3Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,170
- Vote Rating
- 32
There is no proper way to "destroy" or "remove" plugins in Ext JS 3.x. Lots of plugins don't have proper destroy methods. Even if they do (like the ones I've developed), you would have to manually remove them from the "plugins" array.

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
21 Feb 2011 9:28 AM #4
Thanks. But,...
Thanks. But,...
Thank you for getting back to me.
If I have plugin_array = [array_of_plugins] and I loaded a grid with this plugin. I, then manipulate the plugins array, new_plugin_array = [new_array_of_plugins]. Now, how do I make the grid look at this new array of plugins for its plugins?
Is there a function or a property like grid.add({plugins: new_plugin_array}) ?
Thank again.
-
21 Feb 2011 9:30 AM #5Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,170
- Vote Rating
- 32
Code:var newPlugin = new MyPlugin(); newPlugin.init(grid); grid.plugins.push(newPlugin);

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
21 Feb 2011 10:41 AM #6
Intersting...
Intersting...
Okay, this looks good.
I was able to change the plugins for the grid. But, they do not seem to have any effect on the grid.
I am using grid.view.refresh() function to apply the new plugins. Am I supposed to use any other function?
Also, I am using the columnHeaderGroup plugin. My requirement is to change this plugin, remove its previous version from the grid and add the new version to the same. I also add columns and change the way the values are calculated. All the changes are taking effect except the grouping of headers.
Thank for the help.
-
21 Feb 2011 10:55 AM #7Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 43
No need to replace the ColumnHeaderGroup plugin. You only need to change the rows property of the columnmodel.
-
21 Feb 2011 1:56 PM #8
I got it...kinda
I got it...kinda
Hi,
I got what you meant...to have the columheadergroup for the to-be-added columns ready even before the grid is created. This worked.
But, I am worried about the layout.
I have attached the screen-shot ( tgl-effect-scrn.jpg )of the grid column headers before and after the toggle. As you can in the "after toggle" screen-shot, the width of the newly added columns under "G" are larger in width.
Any ideas how to spread the column widths evenly?
Thank you once again. Let me know if you need me to open a new thread for this.
-
20 Oct 2011 3:45 PM #9
image1.jpg
I am dynamically adding column to grid and after addition Ext.ux.grid.FilterRow is not retained.
so i used below mentioned code but still no luck.
var filterRow = new Ext.ux.grid.FilterRow();
filterRow.init(grid);
grid.plugins.push(filterRow);
grid.getView().refresh();
-
3 Apr 2012 9:39 PM #10
BUMP...
BUMP...
Bumping this thread. I'm running into the exact same issue and have found the same recommendation in other threads and forums -- which does not work, at least with 3.2.1
Note: the plugin I'm using is RowExpander
I've tried different variations of:
Code:var myExpander = new Ext.ux.grid.RowExpander({...}); myExpander.init(grid) grid.plugins.push(myExpander); grid.getView().refresh();
Would love to see another suggestion, thanks!Last edited by MarkMan55; 3 Apr 2012 at 10:41 PM. Reason: added code that was tried
Similar Threads
-
Ext.ux.plugins.CustomColumnMenu [Adding custom itens to grid columns headers]
By BoogieMonster in forum Ext 2.x: User Extensions and PluginsReplies: 4Last Post: 11 Mar 2010, 7:15 AM -
Ext.grid.GridPanel - adding plugins dynamic
By phedoreanu in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 26 Jun 2009, 1:20 AM -
adding plugins to a grid after grid is created
By Lasagne in forum Ext 2.x: Help & DiscussionReplies: 6Last Post: 3 Jun 2008, 11:44 PM -
[2.1] Ext.ux.plugins.InvalidCell : Adding an error message to a cell in a grid
By arnold in forum Ext 2.x: User Extensions and PluginsReplies: 0Last Post: 18 May 2008, 3:56 AM


Reply With Quote