Angular DataTable not populating DTInstance

后端 未结 5 1521
抹茶落季
抹茶落季 2021-01-16 08:58

I am not getting my DtInstance populated after rendering. Anyone faced this issue.

<
5条回答
  •  醉酒成梦
    2021-01-16 09:28

    I am using

    .withOption('serverSide', true).withFnServerData(getDataFromServer)
    

    and I was having the same issue, but it was resolved with the following code:

    Controller

    $scope.dtInstance = {};
    $scope.dtIntanceCallback = function (instance) {
        $scope.dtInstance = instance;
    }
    $scope.dtRebind = function () {
        $scope.dtInstance.DataTable.draw()
    }
    

    HTML

提交回复
热议问题