6

I want to add a button to the right hand side of my gridpanel header but can't find anyway of doing so.

I don't want to add a toolbar since it's only 1 button I want to add.

pm13
  • 695
  • 7
  • 23
  • 35

1 Answers1

13

Check out the panel's tools config. Simply add it to grid's config:

Ext.create('Ext.grid.Panel', {
    // ...
    tools:[
    {
        type:'help',
        tooltip: 'Get Help',
        handler: function(event, toolEl, panel){
            // show help here
        }
    }],
    // ...
});

Here is demo.

Molecular Man
  • 21,887
  • 3
  • 67
  • 86
  • Can similar behavior be achieved with ExtJS 3.4.0? – Jay Mar 11 '14 at 14:45
  • @Jay, yes. See the docs http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.Panel-cfg-tools – Molecular Man Mar 11 '14 at 18:17
  • @MolecularMan of course. Actually I did notice that, but when I was playing around with the jsfiddle of yours, help tool didnt show up and that gave me an impression that its not working with 3.4.0. Digging a bit more, found that 3.4.0 has qtip instead of tooltip and also jsfiddle has some issues with 3.4.0, those tool icons don't showup. If I run the same script in my chrome/firefox as a stand alone html/js file, it works. Anyway thanks for your reply and also for original solution. – Jay Mar 13 '14 at 09:28