javascript - Using collection helpers in meteor tabular -
i'm displaying table data using meteor aldeed:tabular
the tabular initialization code simple:
this.tabulartables.customers = new tabular.table({ name: "clients", collection: this.customers, columns: [ {data: "lastname", title: "name"}, {data: "mymessage()", title: "message"} ], });
first field, lastname works perfectly, adding second field mymessage() causes problem
i installed dburles:collection-helpers extension , add helper in common code section:
this.customers = new mongo.collection("customers"); this.customers.helpers({ mymessage: function () { return "hi!"; } });
but still getting error on client side:
exception tracker recompute function: debug.js:41 typeerror: a[i[j]] not function @ c (jquery.datatables.min.js:16) @ jquery.datatables.min.js:17
what might problem helper function , should declare it?
i've done more or less have done , works nicely.
countries = new mongo.collection('countries'); tabulartables = {}; meteor.isclient && template.registerhelper('tabulartables', tabulartables); tabulartables.countries = new tabular.table({ name: "countrieslist", collection: countries, columns: [ {data: 'italian_name', title: 'italian name'}, {data: 'cataloguename',title: 'catalogue name'}, {data: "myfunction()", title: 'wot'} ] }); countries.helpers({ myfunction: function () { return "hi!"; } });
the real difference can see line:
meteor.isclient && template.registerhelper('tabulartables', tabulartables);
Comments
Post a Comment