I am using two views, one original view to show the entire list of items (currently it shows 3 person’s details) and another view is the modal dialog to add a new item to the collection. When I click add in the modal dialog, the new time will populate in the Original view. But I have a button “CancelChanges” in the page and when I click that the Original View must only show the items that were fetched from severe and lose all changes made later. Is there a way I can do that. When I tried to call my Original View ,the page shows a total of 7 person’s details. Original 3 items that were fetched from server + the newly added item from modal dialog and it appended 3 original items to that list.Can anyone let me know how to xclear the initial list from the el?
Share
The simplest way that come in my mind would be to save your initial models data and then restore them when you click your “Cancel changes” button and re-render your view, something like that: