PDA

View Full Version : Plugin that adds toolbar to grid



johanhaest
31 Jul 2012, 6:10 AM
Hi guys, is it possible to add a plugin to a grid that adds a toolbar to it?

I was thinking of something like the following:



Ext.define('Ext.ux.filter.FilterBar', {
alias: 'plugin.filterbar',


init: function (grid) {
var me = this;


grid.tbar = [{
xtype: 'button',
text: 'Button 1'
}];
}
});

mankz
31 Jul 2012, 10:45 AM
Could work, but not that elegant. You can instead call add on the grid panel (since it's a container).

untested


grid.addDocked({ xtype : 'toolbar', items : 'foo', dock : 'top' });

johanhaest
31 Jul 2012, 10:49 AM
Thanks Mankz, it works. I've just tested it.