onBeforeSort

срабатывает перед сортировкой данных

boolean onBeforeSort(string/function/undefined by,string/undefined dir,string/function as);
bystring/function/undefinedtemplate с именем поля для сортировки или функция для сортировки
dirstring/undefinedнаправление сортировки
asstring/functionтип данных для сортировки
booleanfalse отменит сортировку

Example

view.data.attachEvent("onBeforeSort", function(by, dir, as){
    //ваш обработчик
});

Details

Если обработчик события вернет false, данные не будет отсортированы.

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 will be sorted by.
table.sort("#fieldName#", "desc", function(a, b, prop) {
   return a[prop] - b[prop];
})
See also
Наверх
If you have not checked yet, be sure to visit site of our main product Webix ui widget library and page of dataview product.