3.2.0

Cancel sorting options

Clicking on the column headers toggles sort order. I want to click once for ascending, again for descending, and again to turn sorting off. How do I accomplish this?
Kwooda
February 21,
I am doing the following to accomplish my goal, which seems to work, but I cannot get the sort indicator to go away.

var saveDoSort = obj.onHeaderClicked;
function myDoSort(event,index,header) {
    if (this.getSortDirection(index)=="descending") {
        this.setSortColumn(index);
        this.setSortDirection("",index);
    } else {
        if (saveDoSort) saveDoSort(event,index,header);
    }
}

obj.onHeaderClicked = myDoSort;


How do I get the sort indicator to go away on the column header?
Kwooda
February 21,
This is just a thought ... I haven't worked with sorting much.

Could you have a hidden column with the same value in every cell (ex. all have "1" in them). Then on the "sorting off" event maybe you could invoke sorting on the hidden column. Since the values are the same on each cell of the hidden column I don't think it would change the row order (that is a good thing). Also, I'm hoping that would cause the sort indicator to associate with the hidden column instead of the one clicked.

Note: All of this is theory and someone else may have an easier or better answer.

Happy Friday and I hope you don't feel ignored anymore :)
Rob Francis
February 24,
Interesting idea. I'll give it a shot if I can't find another solution. Thanks! ;)
Kwooda
February 24,

This topic is archived.

See also:


Back to support forum