mercredi 19 mars 2014

On Grid with grouping feature, change the sorting order in the grouped column

As an example, suppose that a grid exists with the following columns: Name, Age, Pet.

Also suppose the only possible pets are from the set (Dog, Cat, Fish).

I have applied the grouping feature with

Code:



groupField: 'Pet'


.



By default, the grid is rendered with the rows grouped by pets in the ascending order of possible pets.


Something like:




Code:



Pet: Cat (30)

----------------

[30 Cat Rows]



Pet
: Dog (10)

----------------

[10 Cat Rows]

Pet: Fish (10)

----------------

[10 Cat Rows]





I want to control the sorting order of the grouped column too, so the order of the groups can be descending too:





Code:



Pet: Fish (10)

----------------

[10 Cat Rows]

Pet: Dog (10)

----------------

[10 Cat Rows]

Pet: Cat (30)

----------------

[30 Cat Rows]





The above should be supported for any column (on which grouping is possible) in the grid.


Is there a way to achieve this?




Aucun commentaire:

Enregistrer un commentaire