javascript - Sorting row values in orbjs pivot table -


below code project file:

{  name: '3',  caption: 'career level',  aggregatefunc: 'sumtext',  sort: {      order: 'desc'      } } 

instead of 'desc' sort custom sort based on predetermined array.

as per code orbjs on github how customfunc can added:

name: '4', caption: 'category', sort: {        customfunc: function(a, b) {        if(a.trim() == 'touch screen phones'){             return -1;                     }                if(a < b) return -1;                if(a > b) return 1;                return 0;                    }              }          } 

i have customfunc sort career levels column project contains values ["p1", "ex", "m4"] (length of array varies).

if have sort elements per below array. how create customfunc in github issue link

 ["ex", "m4", "m3", "m2", "m1", "p6", "p5"] 

kindly observe: length of 2 arrays not same. cannot pass array argument.

can please guide me how this? thank in advance :)

i loaded data in order wanted , solved sorting issue me.

for else using orbjs library - if interested develop further please let me know - try as possible.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -