我偶然發現了同樣的問題。在最終編寫一個自己的解決方案來獲得隱藏列表的表格後,我設法解決了您的問題(假設您使用ng-repeat來構建表格)。
HTML:
<div ng-init="friends = [{name:'data11', phone:'data12'},
{name:'data21', phone:'data22'},
{name:'data31', phone:'data32'},
{name:'data41', phone:'data42'},
{name:'data51', phone:'data52'}]"></div>
Search: <input ng-model="searchText">
<table id="searchTextResults" class="footable">
<thead>
<tr><th>Column1</th><th>Column2</th><th data-hide="phone">Column3</th><th data-hide='phone'>Column4</th><th data-hide='phone'>Column5</th></tr>
</thead>
<tbody>
<tr ng-repeat="friend in friends | filter:searchText" my-directive>
<td>{{friend.name}}</td>
<td>{{friend.phone}}</td>
<td>{{friend.phone}}</td>
<td>{{friend.phone}}</td>
<td>{{friend.phone}}</td>
</tr>
</tbody>
</table>
控制器:
.directive('myDirective', function(){
return function(scope, element)
{
if(scope.$last && !$('.footable').hasClass('footable-loaded')) {
$('.footable').footable();
}
var footableObject = $('.footable').data('footable');
if (footableObject !== undefined) {
footableObject.appendRow($(element));
}
};})
希望這有助於。
WOuld建議使用角柵格和您自己的媒體查詢來隱藏列或使用可腳步篩選/排序 – charlietfl