我的咖啡脚本
Template.shiftDataTable.onRendered ( ->
App.datatables()
$('#shift-list-table').dataTable
pageLength: 10,
"order":[[0, "asc"]]
$('.dataTables_filter input').attr('placeholder', 'Search')
)
我的玉模板
.table-responsive
table#shift-list-table.table.table-vcenter.table-condensed.table-hover
thead
tr
th Shift Code
th Shift Type
th Shift Start Date
tbody
each shifts
tr
td {{code}}
td {{type}}
td {{formatDate createdAt}}
问题是当我使用 ironRouter (Router.go, pathFor) 转到此页面时,onRendered 将在渲染之前运行。