Add help button to Extjs gridpanel header
Asked Answered
D

1

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.

Danille answered 14/9, 2011 at 8:45 Comment(0)
R
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.

Recuperative answered 14/9, 2011 at 9:34 Comment(3)
Can similar behavior be achieved with ExtJS 3.4.0?Fireworks
@Jay, yes. See the docs docs.sencha.com/extjs/3.4.0/#!/api/Ext.Panel-cfg-toolsRecuperative
@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.Fireworks

© 2022 - 2024 — McMap. All rights reserved.