:: Forum >>

Sort Checkboxes with checked on top.

My first column in a grid is a checkbox.

when I click on the header for the first time, how do I get the checked rows to be on top.

I understand why its doing it, because the column is set to "false" and "false" comes before "true".

I guess what i'm askings is when you click on the header for first time, how do you get it to sort descending first, instead of ascending but only for that one column?

Thanks for your time
sv
Saturday, August 18, 2007
No one...
sv
Tuesday, August 21, 2007
You should cancel default header click event and call sort() function explicitly -

var checkboxColumn = 1; // let's say checkbox in the second column

obj.onHeaderClicked = function(event, index){
    if (index == checkboxColumn && this.getSortColumn() != checkboxColumn) {
        this.sort(checkboxColumn, "descending");
        return true; // cancel default
    }
}
Alex (ActiveWidgets)
Tuesday, August 21, 2007

This topic is archived.


Back to support forum

Forum search