【发布时间】:2015-07-01 00:13:44
【问题描述】:
此plunker 根据对“Tim”(Json 数据)的搜索正确填充静态 Html 表。
var arrItem = [];
angular.forEach($scope.items, function (item) {
if(item.fname === enteredValue.firstName || item.lname === enteredValue.lastName
||item.address === enteredValue.address && item.phone === enteredValue.phone){
arrItem.push({
first: item.fname,
last: item.lname,
address: item.address,
phone: item.phone
});
现在我想将这些数据放在 NG-Grid 中。
这个plunker 尝试基于 Tim Search 将此数据加载到 NG Grid 中。我尝试了很多方法来做到这一点。现在我正在尝试将 arrItem 分配给 $scope.source 并将其传递给 getPagedDataAsync。有什么想法吗?
$scope.source= arrItem;
$scope.getPagedDataAsync($scope.source, $scope.pagingOptions.pageSize, $scope.pagingOptions.currentPage);
【问题讨论】:
标签: javascript json angularjs angularjs-scope ng-grid