Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8645545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:34:42+00:00 2026-06-12T12:34:42+00:00

I am using two views, one original view to show the entire list of

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:34:45+00:00Added an answer on June 12, 2026 at 12:34 pm

    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:

    Backbone.View.extend({
    
    initialize: function(){
        _.bindAll(this,'restore_collection');
        this.collection.bind('reset',this.render);
        this.originalModels = this.collection.models;    
    },
    
    events: {   
        "click #cancel" : "restore_collection"   
    },
    
    restore_collection: function(){   
        this.collection.reset(this.originalModels);    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I go about having two view models communicate with one another using
I'm using MVC2 with VS2010 I have a view that has two partial views
Currently using Xcode 4.2 and I have two view controllers (1 and 2). I
I have two activities one displaying map view and another listview, the main objective
I have two views of some data: a list view (a ListBox now, but
I have two views, one represents a view of clients and the other is
i have two views 1st one is displaying list (uitableview used), user will select
I've set up a really simple project using storyboards including two views as shown
I'm building a table cell using two bound ember.js views on data. When I
I am using the flip animation to animate between two views in my viewcontroller.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.