fires before sorting of the dataset
| by | string/function/undefined | the template of the sort-by field | 
| dir | string/undefined | the direction of sorting | 
| as | string/function | the type of sorting | 
| boolean | returning false will prevent sorting | 
view.data.attachEvent("onBeforeSort", function(by, dir, as){
    //... some code here ...
});
Returning false from the event handler will block further processing, and data will not be sorted.
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];
})