Jaspreet Singh
Jaspreet Singh

Reputation: 105

How to add button and respective event in groupheader of grouping grid ExtJS

I am using the Extjs4.2.1 and I want to add the Extjs Button in the groupHeader of GroupingGrid.

for the reference please have a look http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.grid.feature.Grouping

Upvotes: 0

Views: 4890

Answers (5)

Pradeep P
Pradeep P

Reputation: 1

I added like this and it worked:

features: [{
    ftype: 'grouping',
    groupHeaderTpl: 'Job Premium Id: {name} <button type="button" onclick="set()">Click Me!</button> {sampleButton}',
}],

Upvotes: 0

Pradeep P
Pradeep P

Reputation: 1

I added the html button in the groupHeaderTpl it worked fine.

features: [{ ftype: 'grouping', groupHeaderTpl: 'Click Me! {sampleButton}', }],

Upvotes: 0

newmount
newmount

Reputation: 1951

groupHeader can be formatted using groupHeaderTpl, and add groupclick listener to listen click events

Sample here: https://fiddle.sencha.com/#fiddle/1dq

Upvotes: 3

VDP
VDP

Reputation: 6420

Putting a real Ext button in the header would be hard... but you can add just about any html to the groupHeader via the groupHeaderTpl.

Upvotes: 0

Vinayak Pingale
Vinayak Pingale

Reputation: 1315

Refer to the EXT JS 4.2 examples by Sencha. Please refer below example.

http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/grid/remote-group-summary-grid.html

Upvotes: -2

Related Questions