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

  • Home
  • SEARCH
  • 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 6086275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:44:00+00:00 2026-05-23T11:44:00+00:00

Using backbone.js, when a collection’s remove method is called a remove event is fired.

  • 0

Using backbone.js, when a collection’s remove method is called a “remove” event is fired.

  1. How can I extend this “remove” event to pass extra data, such as certain attributes of the particular model being removed?

  2. How can I bind to the “remove” event triggered by a specific model, specified by id or cid?

I suppose any solution would also be applicable for the “change” event? Thanks for help.

  • 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-05-23T11:44:00+00:00Added an answer on May 23, 2026 at 11:44 am

    If you’re removing a model from a collection, you shouldn’t need that model anymore. I guess I’m missing the point of extending remove to do more than just remove something.

    When you call remove on a collection, you pass the model or an array of models in the collection to the remove function. I would recommend doing any last minute work you need with those models just before you call the remove function on your collection. At that point you should have all the models and their attributes that you plan on removing.

    To bind to the change event of a specific model you just need to get the model you want from the collection and bind to that:

    var myModel = myCollection.get(id); //using the id of the model
    

    or

    var myModel = myCollection.getByCid(cid); //using the cid of the model
    

    Now bind to that model:

    myModel.bind("change", function() {
        //do something
    });
    

    or, bind change to all the models in a collection:

    myCollection.bind("change", function(model) {
        //do something, model is the model that triggered the change event
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Backbone I can fetch the Collection like below and render a Backbone View
I'm using Backbone along with Mustache, how can I detect when a view is
I'm using backbone js with an xml api data feed. I have a top-level
I've developed a nice rich application interface using Backbone.js where users can add objects
This is my first attempt at using Backbone.js, so I decided to make a
I'm trying to keep track of the state in this app using Backbone.js: I
I am currently using Backbone.js collection and View and I am attempting to bind
I am attempting to bootstrap a backbone collection using an array of JSON objects
I'm using Backbone.js to render a list of items. THis is working, I have
I'm using backbone.js. I get an event from the server that needs to update

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.