Javascript 表不包括';搜索后不更新
我有一个简单的表,我搜索了数据并将其推入表中,然后我应该单击表(进行排序)以显示数据。我只需要在推送数据后显示Javascript 表不包括';搜索后不更新,javascript,angularjs,Javascript,Angularjs,我有一个简单的表,我搜索了数据并将其推入表中,然后我应该单击表(进行排序)以显示数据。我只需要在推送数据后显示 $scope.searchedOwners = []; var initSearchedOwnersTable = function () { $scope.searchedOwnersTableParams = new ngTableParams({ page: 1, count: 9999999999,
$scope.searchedOwners = [];
var initSearchedOwnersTable = function () {
$scope.searchedOwnersTableParams = new ngTableParams({
page: 1,
count: 9999999999,
sorting: {
UserName: 'asc'
}
}, {
total: 0,
counts: [],
getData: function ($defer, params) {
$scope.searchOwnersGridItems = $scope.searchedOwners;
var count = $scope.searchedOwners.length;
params.total(count);
params.count(count);
$defer.resolve($scope.searchOwnersGridItems);
}
});
}
搜索和初始化数据:
$http.post(webApiUrl + '/search?messageTemplateId=' + $scope.messageTemplateId + '&searchQuery=' + $scope.searchQuery).success(function (response) {
$scope.searchedOwners = response;
initSearchedOwnersTable();
}).error(function (response) {
toaster.pop('error', 'Error occurred while deleting the message template owner');
$scope.createError = angular.fromJson(response).Message;
});
这个表格也显示在弹出窗口中,可能是因为
更新
我有两个表格,第一个在主页上,第二个在弹出窗口上。
第一个工作正常,第二个加载数据后不显示此数据,在我单击表的顶部(th标记,排序)后,所有数据都会出现您能更好地解释您的问题吗?在plnkr上制作一个plnkr是最好的(),我无法重现