带有 html5 导出按钮的 meteor-tabular 导出数据

meteor-tabular export data wih html5 export buttons

我正在使用表格查看 table 中集合的数据,但是当我需要使用 html5 导出数据时,导出按钮和按钮 (csvhtml5 ) 仅显示table 中可见的数据长度,并非集合中的所有数据。

https://github.com/aldeed/meteor-tabular#features https://datatables.net/reference/button/csvHtml5

有没有办法导出所有数据?

这是由 Tabular 处理检索数据的方式造成的;它只包含订阅的文档而不是整个集合。

By default, a normal Meteor.subscribe is used for the current page's table data. This subscription is stopped and a new one replaces it whenever you switch pages. This means that if your table shows 10 results per page, your client collection will have 10 documents in it on page 1. When you switch to page 2, your client collection will still have only 10 documents in it, but they will be the next 10.

为了避免这个问题,我们提出了一个涉及修改 tabulardatatables.net-buttons 的 hacky 解决方案,但它太丑了,无法分享,所以我的两分钱是使用原始数据表并将其全部传递数据,它会为您整齐地处理导出。

这里有一些可以帮助您入门的内容:https://datatables.net/forums/discussion/41493/how-to-install-datatables-with-meteor-js-bootstrap-3