0

I have problem with management several tables using Angular DataTables.

Here are fragments of my html code:

<table datatable="ng" dt-options="dtOptions" dt-instance="dtInstance"
                       class="row-border hover table table-striped table-bordered">
<table datatable="ng" dt-options="dtOptions2" dt-instance="dtInstance2"
                               class="row-border hover table table-striped table-bordered">

and that's my controller code:

   $scope.dtInstance = {};
   $scope.dtInstance2 = {};

$scope.dtOptions = DTOptionsBuilder
       .newOptions()
       .withTableToolsButtons([]);

    $scope.dtOptions2 = DTOptionsBuilder
      .newOptions()
      .withTableToolsButtons([]);

I would like to update table2, but can't do it, cause my dtInstance2 is empty, but other works well: all data displayed.

How I can fix it and obtain the dtInstance2?

NikitaAbrosimov
  • 127
  • 1
  • 8

2 Answers2

0

Let me see if I understand you correctly

you want to update the data in Table 2, you could do with creating a button to update dtInstance2.

<button ng-click="dtInstance2.rerender()">update</button>
Hansel
  • 142
  • 1
  • 8
-1

Encountered this problem before, refer to this url https://github.com/l-lin/angular-datatables/issues/307 for the solution.

mouthzipper
  • 300
  • 4
  • 10
  • 1
    Please add some additional examples to your answer. If the github page goes private or changes, your answer will be useless. – dckuehn Aug 25 '16 at 17:26