tonytomov / jqGrid

jQuery grid plugin
www.trirand.com
2.84k stars 1.2k forks source link

[grouping] is there a way to avoid sorting on `groupOrder`? #1040

Closed cesarreyes3 closed 1 year ago

cesarreyes3 commented 1 year ago

groupOrder Can be asc for ascending or desc for descending order. If the grouping is enabled the default value is asc.

From the backend I already have the order (a custom order), but when I load the grid it changes it, is there any way to disable the default order?

tonytomov commented 1 year ago

Hello,

The grid does not change the order it groups by groupField set in grouping options. We always suppose that the data is ordered by that field. See the code in grouping here: https://github.com/tonytomov/jqGrid/blob/master/js/grid.grouping.js#L132

If you use custom order, then it is needed to setup custom group field. You can try to use isInTheSameGroup event.

More here: https://www.guriddo.net/documentation/guriddo/javascript/user-guide/grouping/#options

Some stackoverflow hints: https://stackoverflow.com/questions/16149731/ignore-case-while-grouping