3.2.0

resume original ordering after sorting

How to resume / reset to original default data ordering in an unsort manner after user click some columns for sorting? How to write a function to resume original ordering?
Henry Ng
October 25,
oh, i added this method to the object and it works.
obj.unsort = function(index, direction) {
    if (this.getSortProperty("index") == -1) return;
    direction = "ascending";
    var rows = this.getRowProperty("values");
    if (this.getSortProperty("index")!= index)
        rows.sort(function(x, y) { return x>y ? 1 : (x==y ? 0 : -1) });
    this.setRowProperty("values", rows);
    this.setSortProperty("index", -1);
    this.setSortProperty("direction", "none");
    this.refresh();
};
Henry Ng
October 25,

This topic is archived.

See also:


Back to support forum