0

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:

enter image description here

Updated row are there:

enter image description here

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 });
            });
2
  • jsfiddle.net/benfosterdev/UWLFJ try like this Commented Dec 11, 2016 at 10:24
  • Add more code and this is not enough. Commented Dec 11, 2016 at 14:33

1 Answer 1

0

Just empty the array before push
$scope.PrivilegeliST=[]

then it will replace the updated row

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.