fires after sorting dataset
| by | string/function/undefined | template of sort-by field | 
| dir | string/undefined | direction of sorting | 
| as | string/function | type of sorting | 
view.data.attachEvent("onAfterSort", function(by, dir, as){
    //... some code here ... 
});
If the third param is a function, the parameters of such a function are the following:
table.sort("#fieldName#", "desc", function(a, b, prop) {
   return a[prop] - b[prop];
})