Custom "cellfilter" In Angular Js
I am working with the ng-grid in Angular js. I have this line of code which defines the type of filter added. columnDefs: [{field:'date', displayName:'Birth Date', cellFilter:'da
Solution 1:
Use a custom sort function:
var result = 1;
var test="HML";
function impSortFn(a, b) {
a=test.indexOf(a);
b=test.indexOf(b);
if (a == b) return 0;
if (a < b) return -1;
return result;
}
$scope.gridOptions = {
data: 'myData',
columnDefs: [{
field: 'name',
displayName: 'Name'
}, {
field: 'age',
displayName: 'Age'
}, {
field: 'imp',
displayName: 'Important',
sortFn: impSortFn
}]
Post a Comment for "Custom "cellfilter" In Angular Js"