DTInstances - Reloading of data is not working
See original GitHub issueWhen 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>
Issue Analytics
- State:
- Created 8 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
$scope.dtInstance.reloadData() is not a function when ...
I can see that the datatable is reloading new data, but I am still getting the error. – Riples. Feb 9, 2020 at...
Read more >Datatable Server Side in Angular doesn't show results
On first call, the table is populated but still keeps the "No matching records ... A sample of the table showing as empty...
Read more >Angular datatables reload
I am new to angular js and datatables. In my page, I have a drop down and search. When I change value in...
Read more >cannot read property 'dtinstance' of undefined angular datatable
angular-datatables dtinstance not working ... See the example in the documentation about reloading and changing data.
Read more >Angular Dtinstance Doesnt Exist On Dtelement
The trigger needed to re-render the table. dtTrigger: Subject<any> = new Subject();. segments: number[];. // Object that contains the "segments" data.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is the
dtInstance
variable set in your table?It also works for me. thanks, I just need to follow this example http://codepen.io/l-lin/pen/Gpgxqo?editors=101