onAfterSort

fires after sorting dataset

void onAfterSort(string/function/undefined by,string/undefined dir,string/function as);
bystring/function/undefinedtemplate of sort-by field
dirstring/undefineddirection of sorting
asstring/functiontype of sorting

Example

view.data.attachEvent("onAfterSort", function(by, dir, as){
    //... some code here ... 
});

Details

If the third param is a function, the parameters of such a function are the following:

  • a (object) - the first data item
  • b (object) - the second data item
  • prop(string) - the name of the field that the data have been sorted by.
table.sort("#fieldName#", "desc", function(a, b, prop) {
   return a[prop] - b[prop];
})
See also
Back to top
If you have not checked yet, be sure to visit site of our main product Webix popular javascript framework and page of tree ui product.