The GridPanel also comes with a feature to allow grouping the data by a column, as shown in the following screenshot:
Notice the menu now provides two extra options—to enable grouping at all (Show in Groups) and whether to group by the current column whose menu is being shown.
Tip
Also notice how the formatting for the column value is preserved in the grouping header as well. That is because, if you recall earlier, the Renderer
function we used for that column updated the value itself. So when the Grouping
header is shown, that formatted value is used.
To set this up we simply add another "Feature" to the GridPanel as follows:
<Features>
<ext:GridFilters Local="true">
<!-- Filter options go here -->
</ext:GridFilters>
<ext:Grouping />
</Features>
The preceding example shows the bare minimum configuration needed; just the Grouping
feature. Note, as a client-side feature on the GridPanel, it is independent of the underlying Store...