Reputation: 1030
I am binding a table using angularjs I have two tabs on a same page In first tab New I am inserting data and in tab list I am getting data which have update and delete functionality.
I am attaching the image.
The problem is when I get the edited data then I have to remove the table row which was on a new tab then inserted edited row. How can I do this? Here is the image:
Updated row are there:
I already getting the data but when I used Push method then It is creating newly created row on new tab.
I short My problem is to remove the first row in new tab and inserted the updated row from list tab to new tab.
$.each(data.privilegeList, function (i, o) {
$scope.PrivilegeliST.push({
PrivilageId: o.privilegeId, PageName: o.pageName, PageUrl: o.pageUrl, CanView: o.canView, CanEdit: o.canEdit, CanDelete: o.canDelete, CanCreate: o.canCreate
});
//$scope.PrivilegeliST.push({ PrivilegeId: o.id, OperatorId: 0, PageName: o.pageName, PageUrl: o.pageUrl, CanEdit: false, CanView: false, CanDelete: false, CanCreate: false });
});
Upvotes: 0
Views: 72
Reputation: 1030
Just empty the array before push
$scope.PrivilegeliST=[]
then it will replace the updated row
Upvotes: 0