1

i am using aldeed tabular.

Everything works great but when I add a collection helper row, this row is not sortable nor searchable.

New Tabular.Table definition is:

TabularTables.Cars = new Tabular.Table({ 
name: "CarsTable", 
collection: Cars,
 extraFields: ['importDate', 'dateExp', 'dateDeSortie'],
 columns: [ 
{ data: "importDate", title: "Date d'Import",
 render: function (data) { if (!data) return ""; return moment(data).format(Global.DATE_FORMAT); } }]

the search function is :

switch (idxCol) { 
case 0: 
searchTerm = this.searchPatternDateImport()} 
var col = $("#carsTable").DataTable().column(idxCol);//1.2.3.4 col.search(searchTerm).draw();

How can i solve this ?

sana
  • 133
  • 8

1 Answers1

2

It looks that at this moment Tabular Table doesn't provide out of the box solution for sorting and searching for dynamically rendered attributes.
It is due to the fact, that under the hood for sorting and searching Tabular uses your collection (defined in new Tabular.Tables({}) as "collection" parameter - in your example "Cars" collection) which actually doesn't contain dynamically rendered fields. Since the field is not in the respective collection (exisist only virtualy) you can't sort it or search it.

See more discussion here: https://github.com/aldeed/meteor-tabular/issues/162