I have a angular ui-grid in which I have column 'note' which can be either blank or non-blank. I am trying to create a custom filter to filter out blanks and non-blanks. I am not able to filter out blanks in the column. The column might contain null,undefined or ''. All these are shown as blank in ui-grid. Note column is below:
{
      displayName: 'Note',
      enableSorting:true,
      enableFiltering: true,
      enableCellEdit: false,
      width: '10%',
      field: 'note',
      visible: false,
      filterHeaderTemplate: '<div class="ui-grid-filter-container" ng-repeat=\
      "colFilter in col.filters"><div my-custom-dropdown2></div></div>',
      filter: {
        options: ['Blanks','Non-blanks']     // custom attribute that goes with custom directive above
      } 
.directive('myCustomDropdown2', function() {
  return {
    template: '<select class="form-control" ng-model="colFilter.term" ng-change="filterNotes(colFilter.term)" ng-options="option for option in colFilter.options"></select>',
    controller:'NoteController'
  };
})
.controller('NoteController',function($scope, $compile, $timeout){
  $scope.filterNotes = function(input){
    var field = $scope.col.field;
    var notes = _.pluck($scope.col.grid.options.data,field);
    $scope.colFilter.listTerm = [];
    var temp = notes.filter(function(val){if(val && val!=''){return val}});
    $scope.colFilter.listTerm = temp;
    $scope.colFilter.term = input;
    if(input=='Blanks'){
      $scope.colFilter.condition = new RegExp("[\\b]");
    }
    else{
      //for Non-blanks
      $scope.colFilter.condition = new RegExp($scope.colFilter.listTerm.join('|'));
    }
    console.log("$scope.colFilter.condition",$scope.colFilter.condition);
    // console.log("temp",temp);
  }
})
I have tried solutin given in this question and many more. Nothing worked. How should I create regex to match only blank cells?
 
    