PDA

View Full Version : Hide collapse/Expand button in Group header in Grid panel



suryanarendra
12 Nov 2012, 5:41 PM
Hi,

In grid I would like to retain grouping feature along with groupHeaderTpl (Currently showing some custom text in the headers) , but want to hide [+/-] button in the header.

I tried with css styles but not able to get it. Can somebody help me to achieve this.

Thanks & Regards,
Nari

mitchellsimoens
14 Nov 2012, 10:10 AM
.x-grid-group-hd-collapsed .x-grid-group-title {
background-image: none;
}

suryanarendra
14 Nov 2012, 11:37 AM
I would like to apply this to only one of my Grid but not to all, so it must be custom to its grid.
All groups will be auto expanded always, so which css property I need to set in group header to get this.

I tried hdCollapsedCls: 'mytestclass' but its not working.

css class:

.mytestclass .x-grid-group-hd-collapsed .x-grid-group-title {
background : none !important;
background-image: none !important;
}

mitchellsimoens
14 Nov 2012, 12:29 PM
Have you inspected the DOM to see if your CSS is on the correct element?

suryanarendra
14 Nov 2012, 12:38 PM
I inspected the DOM and the problem is that CSS is not getting applied to the element after setting hdCollapsedCls to my custom css class.

suryanarendra
14 Nov 2012, 12:51 PM
The way I defined grouping is

this.groupingFeature = Ext.create('Ext.grid.feature.GroupingSummary', {
startCollapsed:false,
hdCollapsedCls:"mytestclass",
groupHeaderTpl:'Number: {[values.rows[0].data.xxx]}'
});


Ext.applyIf(me, {

......
features:[this.groupingFeature],
.....
});

From firebug I can see my custom css class got loaded but not applied to the group header.