Sort multiple columns with dgrid

How to change the default behavior of grid.js::_setSort() to correctly display sorting criteria (up / down arrow) in the header of all columns involved in sorting? Currently, _setSort() only works with the first column of the array passed to grid.set("sort") . For example, after setting the sorting criteria using the following command, only the col1 header will contain an arrow (up arrow in this case).

 grid.set("sort", [{attribute: col1, descending: false}, {attribute: col2, descending: true}]); 

I could override _setSort() , but the underscore tells me that this is a private function ...

+7
source share
1 answer

Underscore means that the function should be considered confidential, but that does not mean that you cannot redefine it. I would come forward and succeed in your redefinition. :)

0
source

All Articles