Multiple Column Sorting With dgrid
Asked Answered
A

1

7

How can I change the default behavior of grid.js::_setSort() in order to correctly display the sort criteria (up/down arrow) in the header of all the columns involved in a sort? Currently, _setSort() only deals with the first column of the array passed to grid.set("sort"). For example, after setting the sort criteria with the following command, only the header of col1 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 it's a private function...

Apocarp answered 23/1, 2013 at 18:22 Comment(0)
W
0

The underscore just means that the function should be treated as private, but that doesn't mean you can't override it. I would go forth and prosper with your override approach. :)

Woodyard answered 23/9, 2013 at 19:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.