PDA

View Full Version : [FIXED] Ext4: How to do grid grouping groupHeader with dynamic grouping field header text?



jimmylu98
28 Jun 2011, 11:46 AM
I made the grid grouping working in Ext4. However, there is a little different from Ext3.

By default in Ext3, the groupHeader is: grouping filed header text : grouping field value. It is dynamic change when you group by different fields.

However, By default in Ext4, the groupHeader is: 'Group:' grouping field value. The 'Group' will not change when you group by different fields.



var groupingFeature = Ext.create('Ext.grid.feature.Grouping',{ groupHeaderTpl: 'Group: {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})' });


Is there a way to use groupHeaderTpl to have groupHeader with dynamic grouping field header text? Thanks.

Best regards,
Jimmy

jsakalos
29 Jun 2011, 5:40 AM
Documentation is not specific on what data would groupHeaderTpl get when running so you could probably console.log tamplate's values and/or this objects if they contain what you need.

jimmylu98
29 Jun 2011, 7:14 AM
Thank you. But I think at minimum Ext4 shall provide same default grouping behavior like Ext3.

Please see attachment for comparison between Ext3 and Ext4. It is very clear Ext4 has two problems for group header: (1) Incorrect Group header name, (2) Incorrect Group name. Both shall use rendered values dynamically, not (1) predefined 'Group' and (2) store values.

I would say this is a bug.

Best regards,
Jimmy

jsakalos
29 Jun 2011, 7:46 AM
OK, I can move this thread to Bugs if you want.

jimmylu98
29 Jun 2011, 8:06 AM
Yes, Please.

Thanks.
Jimmy

Daniel Salvi
20 Sep 2011, 11:40 AM
Any luck on this? Makes much sense to use the 'rendered' value as the group name. Seems the feature doesn't give flexibility.

Thanks

jimmylu98
20 Sep 2011, 12:24 PM
Not yet. I am waiting for next extjs release 4.1?