我想过滤数据表,但我无法做到这一点

时间:2017-09-07 07:50:28

标签: angularjs datatables

我想根据给定的字符串过滤数据表,但我无法做到这一点。 这是查看代码: -

<div ng-if="pageScope.tableViewLoad" class="well innerN">
                    <div class="fl" style="height:40px; width:30px;"></div>
                    <table datatable="ng" dt-options="dtOptions" dt-columns="dtColumnDefs" dt-instance="showRolodexTable" class=" table table-striped table-hover  border-top-bottom  wdth-frst-rolodex fixed-table rolodextable tr-cell" width="100%" style="min-width:1013px">
                        <thead>
                        </thead>
                        <tbody>
                            <!-- <tr ng-repeat="user in ulList | rolodexFilter:searchRolodex:searchCriteria:categoryMap" on-finish-render="ngRepeatRolodex" class="test" ng-click="testdemo()"> -->
                            <tr ng-repeat="user in ulList | rolodexFilter:searchRolodex:searchCriteria:categoryMap track by $index" on-finish-render="ngRepeatRolodex" class="test">

以下是控制器代码: -

$scope.searchDataTableUsers=function(){
     localStorage.setItem("namecopy",$scope.searchRolodex);
         if(name1!=null)
         {
            $scope.searchRolodex=name1;
            name1=null;
         }
    if(!$scope.searchRolodex==null){
                   var newUlList = $scope.ulList.filter(function(ulList){
                       return ulList.$filter('$scope.searchRolodex');
                   });
                   console.log("Pawan New list |",newUlList);
               }
    if($scope.oTableRolodex && $scope.searchRolodex && $scope.searchRolodex.trim().length > 0)
    $scope.oTableRolodex.DataTable.search($scope.searchRolodex).draw();
}

$scope.showRolodexTable = function(dtInstance) {
    $scope.oTableRolodex = dtInstance;
    $scope.searchDataTableUsers();
}

$scope.$watch('searchRolodex', function (newValue, oldValue) {
   localStorage.removeItem("namecopy");

  $scope.searchDataTableUsers();

});

我希望,有人会在这方面提供帮助。

PS:提前致谢。

PPS:有人来帮忙。?

0 个答案:

没有答案