0

I have converted my tables from angular to datatables. Now I'm unable to filter out the rows.

<table datatable="" dt-options="dtOptions" dt-columns="dtColumns">
    <tr>
                                        <th class="Header">Feature</th>
                                        <th class="Header">ID</th>

                                        <th class="Header">Log</th>
                                        <th class="Header">Location</th>
    </tr>
</table>

When user Selects Checkbox Exclude Non-members. I was using ng-if to remove the row. Now I'm using DTColumnbuilder to build the table, so ng-show and if aren't working.

$scope.dtOptions = DTOptionsBuilder.fromSource('/Summary/'+item)
                    .withDataProp('responseData')
                    .withOption('serverSide', false)
                    .withOption('processing', false)
                    .withOption('bPaginate',false);
                    $scope.dtColumns = [
                    DTColumnBuilder.newColumn('feature').withTitle('Feature').withOption('width', '20%'),
                    DTColumnBuilder.newColumn('ID').withTitle('ID').withOption('width', '20%'),

                    DTColumnBuilder.newColumn('Log').withTitle('Log').withOption('width', '40%'),
                    DTColumnBuilder.newColumn('Location').withTitle(' Location').withOption('width', '20%')

                ];

So basically if the user selects checkbox,it should remove the rows whose id matches non-members. Just can't figure this out with datatables.

davidkonrad
  • 83,997
  • 17
  • 205
  • 265
matrixguy
  • 286
  • 1
  • 6
  • 30
  • You should filter rows by using a [custom filter](https://datatables.net/examples/plug-ins/range_filtering.html), angular directives such as `ng-show` would never work with dataTables out of the box - and even if they did, it would be the wrong approach. You would not hide rows with for example jQuery `.hide()` in a non-angular app neither. – davidkonrad Aug 19 '16 at 09:05
  • Possible duplicate of [ng-show not working in datatables columns](https://stackoverflow.com/questions/38657552/ng-show-not-working-in-datatables-columns) – Durgpal Singh Jul 20 '17 at 07:25

0 Answers0