2017-02-23 80 views
0

我使用的是aldeed表格。如何過濾/搜索助手的列

一切都很好,但是當我添加一個集合幫助者行時,這行不可排序也不可搜索。

New Tabular.Table定義是:

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); } }] 

搜索功能是:

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

我怎樣才能解決這個問題?

回答

0

看起來在這個時候,Tabular Table沒有提供開箱即用的解決方案來排序和搜索動態呈現的屬性。
這是由於事實,在排序和搜索引擎蓋下Tabular使用您的集合(在新的Tabular.Tables({})中定義爲「集合」參數 - 在您的示例「汽車」集合)實際doesn'包含動態呈現的字段。由於該字段不在相應的集合中(僅存在於虛擬目錄中),因此無法對其進行分類或搜索。

查看此處的更多討論:https://github.com/aldeed/meteor-tabular/issues/162