This repository was archived by the owner on Feb 2, 2025. It is now read-only.
Description When i follow the example here: https://l-lin.github.io/angular-datatables/#/dataReloadWithPromise
I always get an "TypeError: vm.dtInstance.reloadData is not a function" error
I have tried with the exact same code as stated in the example and i have tried to implement it into mine, which is also resulting in the same error.
var vm = this;
vm.dtOptions = DTOptionsBuilder.fromFnPromise( function()
{
return $resource($scope.sourceUrl).query().$promise;
})
.withOption('bInfo', false)
.withOption('paging', false)
.withOption('filter', false)
.withOption('rowCallback', rowCallback);
// Create the table columns
vm.dtColumns = [
DTColumnBuilder.newColumn('customer').withTitle('Kunde / Anzeigedrucke'),
DTColumnBuilder.newColumn('today').withTitle('Heute'),
DTColumnBuilder.newColumn('week').withTitle('7 Tage'),
DTColumnBuilder.newColumn('month').withTitle('30 Tage')
];
vm.newPromise = newPromise;
vm.reloadData = reloadData;
vm.dtInstance = {};
function reloadData()
{
var resetPaging = false;
vm.dtInstance.reloadData(callback, resetPaging);
}
function callback(json)
{
console.log(json);
}
<button ng-click="controller.reloadData()" type="button" class="btn btn-info">
<i class="fa fa-refresh"></i> Reload data
</button>
👍 React with 👍 3zeta-24, trainoasis and jonny-pacheco