我有一个ng2-smart-table,其中包含一个与表字段交互的全局搜索过滤器。它适用于没有任何渲染的列。这是我的代码
onSearch(query: string = '') {
if(query != ""){
this.pages.setFilter(
[
// fields we want to include in the search
{
field: 'productTypeDescription',
search: query
},
{
field: 'products',
search: query
},
{
field: 'varianti',
search: query
}
], false);
}
这些是我的专栏
productTypeDescription: {
title: 'Tipo prodotto',
filter: false,
class: "colonneTabella",
width: "20%",
},
products: {
title: 'Prodotto',
filter: false,
class: "colonneTabella",
width: "20%",
valuePrepareFunction: (products) => {
var output ="";
var outputs = "";
products.forEach(function(item){
output = item.productDescription
item.variantList.forEach(function(el){
outputs= output;
})
})
console.log(outputs)
return outputs;
//return JSON.stringify(value)}
}
},
varianti: {
title: 'Varianti',
filter: false,
class: "colonneTabella",
type: 'custom',
width: "20%",
renderComponent: VariantsProductRenderComponent,
}
我的搜索仅适用于第一列,但不适用于" varianti"和"产品"。我没有找到关于这个问题的任何内容,你知道一个可能的解决方案吗?感谢