PDA

View Full Version : Add buton to grouping header



ssamuel68
12 Apr 2013, 8:09 AM
Hi,

Is possible to add an extjs button to a grouping header?

For now, my grouping code is this one:

var groupingFeature = Ext.create('Ext.grid.feature.Grouping',{
groupHeaderTpl: 'Name: {name}'
});

I want to add a button on the header and manage a click action.

Thx

slemmon
13 Apr 2013, 9:10 PM
The grouping header doesn't have a config to render components like buttons. The groupHeaderTpl (http://docs.sencha.com/ext-js/4-2/#!/api/Ext.grid.feature.Grouping-cfg-groupHeaderTpl) will render out text/HTML.

It would be possible to render a button to an element in the group header, but it won't be managed by the grid, view, etc. so when the grid is destroyed you'll need to make sure you destroy components rendered to the grouping header.