javascript - Custom "cellfilter" in Angular js -
I am working with NG-Grid in Angular JS. I have this line of code that defines the type of filter. important column In the value "H" "L" and "M" is the normal (alphabetical) sorting, I can get a type of H-L-M but as "H-ML" One way to define filters is by Kiss Also help is appreciated !! Thanksgiving Use a custom sort function: < / Div>
var result = 1; var test = "HML"; function impSortFn (a, b) {a = test.indexOf (a); b = test.indexOf (b); if (a = = B) returns 0; if (A and lieutenant; b) return -1; return result;} $ Scope.gridOptions = {data: 'myData', columnDefs: [[field: 'name', displayName: 'name' }, {Field: 'age', displayName: 'age'}, {field: 'imp', displayName: 'important', sortfane: importfo}]
Comments
Post a Comment