JQuery DataTable not working on Meteor

一曲冷凌霜 提交于 2019-12-06 04:14:53
MKM

As per meteor-talk, JQuery dataTables duplicates a lot of the sorting and DOM manipulation functions that MiniMongo, Spark, and Spacebars provide. So even if you can get the styling sorted out (or decided to ignore styling), sorting and other functions wind up not behaving like one is expecting when the table reactively updates underneath DataTables.

Having said so, on July 30, 2014 Austin Rivas, the creator of the meteor-jquery-datatables (which menway - creator of the menway:jquery-datatables package forked to create the Meteor Datatable package) mentioned in Meteor Google support groups:

There are lots of difficulties with using jquery-datatables and meteor together do to duplicate functionality and having to reconcile jquery-datatables dom state with meteor reactivity.

So it might be a good idea to check another package or possibly check alternative approaches for pagination: https://github.com/awatson1978/clinical-ui-crud-table

Personally I would recommend Reactive Table https://github.com/ecohealthalliance/reactive-table. It is quite stable, easy to implement / configure.

See also:

  1. Remove the mrt version:

    mrt remove jquery-datatables

  2. Add the Meteor 0.9+ version:

    meteor add menway:jquery-datatables

However, it seems like it is still not 0.9 compatible as package.js still uses spacebars. Give it a shot, though.

Maybe it's worth looking at this extension instead: https://atmospherejs.com/ephemer/reactive-datatables

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!