AngularJS ng-table 过滤和排序不起作用

AngularJS ng-table Filtering and Sorting not working

我看过关于相同场景的其他主题,但 none 能够帮助我解决此问题。

我在 AngularJS 应用程序中使用 ng-table。我能够显示数据并且分页工作正常但列过滤和排序不起作用。我能够让过滤器出现,但它们什么也没做。

这是我的 HTML table 的样子:

<table ng-table="tableParams" show-filter="true" class="paginationclass" style="width: 100%" border="1">

    <tr ng-repeat="counter in $data">
        <td data-title="'Survey Header ID'" filter="{ surveyHeader_id: 'text'}" sortable="'surveyHeader_id'">{{counter.header.surveyHeader_id}}</td>
        <td data-title="'Survey ID'" filter="{ survey_id: 'text'}" sortable="'survey_id'">{{counter.header.survey_id}}</td>
        <td data-title="'VOC Channel'" filter="{ vocChannel_name: 'select'}" filter-data="DD.vocchannels_dd" sortable="'vocChannel_name'">{{counter.header.vocChannel_name}}</td>
    </tr>

</table>

这是我的 JS 控制器中的代码:

    var tableParams = {
        count: 15
    };
    var tableSettings = {

    };

$http.jsonp(URL)
    .success(function (data) {
        $scope.surData = data;

        tableSettings.data = $scope.surData;
        $scope.tableParams = new NgTableParams(tableParams, tableSettings);
    }

我做错了什么?

Ng-table 排序在嵌套 objects 上不起作用。尝试在没有 header 的情况下构建数据,使其看起来像:counter.surveyHeader_id 而不是 counter.header.surveyHeader_id