iron-meteor / iron-router

A client and server side router designed specifically for Meteor.
MIT License
1.98k stars 413 forks source link

onAfterAction does'nt work well #1509

Open emehmet opened 8 years ago

emehmet commented 8 years ago

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

}