PDA

View Full Version : Accessing Grid Plugins



tomhoag
13 May 2010, 7:27 AM
What is the appropriate way to determine what plugins a grid might be using?

For now, I'm doing the following, but I'm accessing undocumented properties. Is this OK? or is there a better way to go about this?


// if this grid is using a filter plugin, clear the filters
if(Ext.isDefined(this.plugins) && Ext.isArray(this.plugins)) {
Ext.each(this.plugins, function(item, index, allItems) {
if(item.constructor.ptype == "gridfilters")
item.clearFilters();
}, this);
}

14 May 2010, 3:53 AM
that's the only way to do it.

Rothariger
14 May 2010, 4:00 AM
just a little improvement.


if(Ext.isDefined(this.plugins) && Ext.isArray(this.plugins)) {
Ext.each(this.plugins, function(item, index, allItems) {
if(item instanceof Ext.ux.plugin.whatever)
item.clearFilters();
}, this);
}

tomhoag
14 May 2010, 4:05 AM
Great. Thanks!

Animal
14 May 2010, 5:29 AM
I think this is a neglected requirement, and something should be put into the library.

I have a findPlugins method somewhere at my home office. If you bump this thread later, I'll look it up.

tomhoag
14 May 2010, 3:27 PM
Bumping to remind Animal . . .