suman goud

suman goud

  • NA
  • 176
  • 54.1k

How to write loop for bind data to multiple rows in table

Sep 30 2016 2:20 AM
am getting table row index =1,
d.data=Amount:"1000",Party:81,Pendings:"400"
and c=81
c and Party are id of customer dropdown
if table index==1 ,then i want to pass id and index to bind values based on id,
and then for new row i want to pass index and id
how to write loop for this
js code
$scope.rvm = [{}];
//dropdown change event here
$scope.GetAccountBalance = function (index, c) {
//table row index here
var rowID = $scope.rvm.length;
//getting pending data from database based on customer
var getPendingData = ReceiptsService.GetPendings(c);
getPendingData.then(function (d) {
$scope.ReceiptsViewModel = d.data;
}, function (error) {
alert('Error');
});
//adding row on plus click
$scope.addRow = function (index,c) {
if ($scope.rvm.length == (index + 1)) {
$scope.rvm.push( {
});
}
}
$scope.deleteRow = function ($index) {
$scope.rvm.splice($index, 1);
}

Answers (1)