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,
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();
};
This topic is archived.
ActiveWidgets is a javascript library for creating user interfaces. It offers excellent performance for complex screens while staying simple, compact and easy to learn. Deployed by thousands of commercial customers in more than 70 countries worldwide.
Copyright © ActiveWidgets 2021