0

Angular DataTables を使用していくつかのテーブルを管理する際に問題があります。

ここに私のhtmlコードの断片があります:

<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">

それが私のコントローラーコードです:

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

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

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

table2 を更新したいのですが、dtInstance2 が空であるため実行できませんが、他のものはうまく機能します。すべてのデータが表示されます。

どうすれば修正して dtInstance2 を取得できますか?

4

2 に答える 2

0

私があなたを正しく理解しているかどうか見てみましょう

表 2 のデータを更新する場合は、dtInstance2 を更新するボタンを作成します。

<button ng-click="dtInstance2.rerender()">update</button>
于 2016-06-17T17:01:19.890 に答える