无法显示表头的下拉列表,获取TypeError

时间:2016-04-09 00:29:32

标签: angularjs smart-table

我正在尝试使用多个select something like this来显示表标题列表。在这里,我看到该集合未定义且谓词正在传递,并且不显示不同的itmes数据。

我收到以下错误:

angular.js:13236 TypeError: displaySetter is not a function

at StTableController.pipe (smart-table.js:163)
at StTableController.sortBy (smart-table.js:124)
at sort (smart-table.js:354)
at m.$eval (angular.js:16820)
at m.$apply (angular.js:16920)
at HTMLTableCellElement.sortClick (smart-table.js:360)
at Rf (angular.js:3398)
at HTMLTableCellElement.Qf.d (angular.js:3386)`

1 个答案:

答案 0 :(得分:0)

这可能是因为未正确配置st-table属性。确保已在st-table中配置了列表(在ng-repeat中可用)。在下面的示例中,customerList被添加到st-table属性中。

<table st-table="customerList" class="table table-striped">
    <thead>
        <tr>
            <th>Account Number</th>
            <th>Customer Name</th>            
            <th>Address</th>
            <th>City</th>            
            <th>state</th>

        </tr>
        <tr>
            <th colspan="3"><input st-search placeholder="global search" class="input-sm form-control" type="search"/></th>
    </tr>
    </thead>   
    <tbody>
        <tr 
            ng-repeat="customer in customerList">
            <td>{{customer.accountNumber}}</td>
            <td>{{customer.name}}</td>
            <td>{{customer.address}}</td>            
            <td>{{customer.city}}</td>
            <td>{{customer.state}}</td>           
        </tr>
    </tbody>
</table>