无法在 Angular ng2-smart-table 中搜索自定义呈现的单元格

Unable to search into custom rendered cells in Angular ng2-smart-table

呈现 "custom" 字段的一个副作用是全局搜索不再能够在其中工作。我相信发生这种情况是因为单元格开始时是一个 json 对象,然后我只在该对象中渲染一个字符串。因此,全局搜索无法进入它。我基本上是循环遍历对象列表,然后显示该对象中的单个 属性(字符串)以显示在该单元格中。不幸的是,所有这些文本对全局搜索都是不可见的。有没有一种方法可以将自定义呈现的文本添加到全局搜索中?我已经包含了渲染组件的代码:

@Component({
    selector: 'scope-renderer',
    template: `
        <ul class="list-unstyled">
            <li *ngFor="let scope of scopes">
                {{ scope.displayName }}
            </li>
        </ul>
    `
})
export class ScopeRendererComponent implements OnInit {
    @Input() rowData: any;

    scopes: Array<Scope>;

    ngOnInit() {
        this.scopes = this.rowData.scopes;
    }
}

class Scope {
    name: string;
    displayName: string;
    description: string;
    required: boolean;
    emphasize: boolean;
    showInDiscoveryDocument: boolean;
}

这里有一个错误:https://github.com/akveo/ng2-smart-table/blob/master/src/ng2-smart-table/lib/data-source/local/local.filter.ts#L11 将“”作为单元格值提供给任何非基本 属性 的 filterFunction。

我所做的就是像这样破解组件(link 以上):

return data.filter(function (el) {
    //var value = typeof el[field] === 'undefined' || el[field] === null ? '' : el[field];
    return filter.call(null, el, search);
});

并将整个元素传递给过滤器。然后,我在 filterFunction 中拥有该项目的全部内容。

filterFunction(el?: any, search?: string): boolean {          
  return true;
}

而且很适合我。