【发布时间】:2014-11-24 13:27:09
【问题描述】:
我见过 this question 并且解决方案非常简单,但是 this plunker 似乎不适用于我在项目中使用的 Angular 1.33。
这里是 the same plunker 的问题(仅将 Angular 更新到版本 1.33)。
HTML
<table ng-table="tableParams" show-filter="true" class="table">
<tr class='listing' ng-repeat="invoice in $data">
<td data-title="'Invoice No.'" sortable="'no'" filter="{'no':'text'}">
{{invoice.no}}
</td>
<td data-title="'Date'" sortable="'date'" filter="{'date':'text'}">
{{invoice.date}}
</td>
<td data-title="'Client'" sortable="'client.fullname'" filter="{'client.fullname':'text'}">
{{invoice.client.fullname}}
</td>
</tr>
</table>
【问题讨论】:
-
如果您从过滤器中删除 .fullname ,它将使用有效的对象的所有属性(我认为)。这会给您带来其他问题吗?
-
@DoctorMick 我知道...但我需要
full_name列不仅可搜索...而且如果我删除属性我将无法在多个字段中搜索在user嵌套对象中。 -
过滤器语法似乎已更改为使用正确的 JSON 表示法:github.com/angular/angular.js/issues/6222。我的猜测是 ngTable 没有相应地更新。
-
是的,我想是的。.dotted 字符串解析不正确
-
stackoverflow.com/a/26741658/4104866 看看,ngtable 根本不解析点