onAfterAction does'nt work well
Opened this issue · 0 comments
emehmet commented
There is a dataTables object it's created in Template.listedWorks.onRendered. I use AppllicationController. We call dataTable after the page render. We use onAfterAction for this reason.
But this works true while the page is loading(on refresh) and when we reach to page which contain Template.listedWorks.onRendered from other pages it's works after onAfterAction. But it's
necessary load first.
My code is below:
onAfterAction: function() {
if ($('#data-table').length !== 0) {
$('#data-table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
responsive: true
});
}
console.log("onAfterAction");
}