DHTMLX Docs & Samples Explorer


Items can be sorted by any properties. Default sorting process values as strings, case insensitive.

//sort all data by Maintainer property in ascedent order
//same but in descedent order

If you need a custom sorting rule you can define your own sorter function

    view.sort(function(objA, objB){
         //objA and objB - are objects which need to be compared
         return objA.some_value > objB.some_value?1:-1;

Custom sorting method accepts two object and must return 1 if first object is greater than second one, or -1 otherwise.

Direction parameter

  • “asc” - ascedent order, case insensitive
  • any other value - descedent order