:: Forum >>
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
Monday, October 25, 2004
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
Monday, October 25, 2004
This topic is archived.
Back to support forum
Forum search