i have ng-table (angular.js datable) implementation 25 records per page, on page have submit button on clicking need iterate through records in pages find records have been modified in table.
below code can iterate through records in current selected page, not rest of pages.
$scope.tableparams = new ngtableparams( { page: 1, count: 25, }, { total: records.length, getdata: function ($defer, params) { $scope.data = params.sorting() ? $filter('orderby')(records, params.orderby()) : result; $scope.data = params.filter() ? $filter('filter')($scope.data, params.filter()) : $scope.data; $scope.data = $scope.data.slice((params.page() - 1) * params.count(), params.page() * params.count()); $defer.resolve($scope.data); } }); var skus = []; angular.foreach($scope.tableparams.data, function (product) { if (product.quantity > 0) { var sku = { addtocart: true, categoryid: product.categoryid, pricecharged: product.displayprice, quantity: product.quantity, skucode: product.skucode } skus.push(sku); } });
probably use event ngtableeventschannel.ondatasetchanged catch modified row , copy new object. might try use ng-change on edited cell.
and remember have records in records object.
Comments
Post a Comment