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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -