angularjs - kendo TreeList: sort columns based on parent element only? -


here example kendo treelist. how can sort data in treelist, depending on values based on parent element?

in example, if sort data on column 'p names', child elements sorted. how can sort parent elements?

thanks in advance.

you need add custom comparer column.

look in kendo docs

in case this:

$("#grid").kendogrid({     datasource: datasource,     sortable: true,     columns: [{         field: "item",         sortable: {             compare: function(a, b) {                 if(a.level>1){                          var datarows = $scope.grid.items();                          var arowindex = datarows.index(a);                          var browindex = datarows.index(b);                          return arowindex > browindex ;                          }                          else                             return a.item> b.item;                 }             }         }]     }); 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -