Mongodb 有人和《流星》中的aldeed:表格软件包合作过吗?
我正在尝试aldeed:meteor中的表格包。 这是我的密码 客户端:Mongodb 有人和《流星》中的aldeed:表格软件包合作过吗?,mongodb,meteor,tabular,Mongodb,Meteor,Tabular,我正在尝试aldeed:meteor中的表格包。 这是我的密码 客户端: TabularTables = {}; Books= new Mongo.Collection('books'); Meteor.isClient && Template.registerHelper('TabularTables', TabularTables); TabularTables.Books = new Tabular.Table({ name: "BookList", colle
TabularTables = {};
Books= new Mongo.Collection('books');
Meteor.isClient && Template.registerHelper('TabularTables', TabularTables);
TabularTables.Books = new Tabular.Table({
name: "BookList",
collection: Books,
columns: [
{data: "title", title: "Title"},
{data: "author", title: "Author"},
{data: "copies", title: "Copies Available"},
]
});
在html文件中:
{{> tabular table=TabularTables.Books class="table table-striped table-bordered table-condensed"}}
我可以看到形成的表格,但在表格中显示数据时遇到问题。我做错了什么?也许您只在客户端定义了表格表?将其定义为共享资源(例如,在客户端文件夹之外)应该可以解决您的问题。也许您只在客户端定义了表格表?将其定义为共享资源(例如,在客户端文件夹之外)应该可以解决您的问题。我们可以将其放置在公共代码中的什么位置,以便它不会每次都被初始化?也就是说,如果您在该文件中放置一个console.log,那么每次刷新应用程序时(即使您没有实际加载表),您都会看到它。我们可以将它放置在公共代码中的什么位置,以便它不会每次都被初始化?例如,如果在该文件中放置console.log,则每次刷新应用程序时都会看到它(即使您没有实际加载表)