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 9251817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:47:43+00:00 2026-06-18T10:47:43+00:00

I am writing a backbone.js app, and I have a problem. My collections do

  • 0

I am writing a backbone.js app, and I have a problem.
My collections do not fire events, can anyone spot the problem in the code bellow? I get the render-feedback, the initializer feedback.. but the append method is never called. I know that the “../app” returns a list with tro json items. And I can even see that these are being created in the collection.
Why do my event not get called?

window.TablesInspectorView = Backbone.View.extend({

    tagName: "div",

    initialize: function () {
        console.log('Initializing window.TablesInspectorView');        

        // setup the tables
        this.data     = new Backbone.Collection();
        this.data.url = "../app";
        this.data.fetch();

        // some event binds..
        this.data.on("change", this.render     , this);
        this.data.on("add"   , this.append_item, this);
    },
    render: function(){
        console.log("render");
        _.each(this.data.models, this.append_item);
    },
    append_item: function(item) {
        console.log("appended");
    }
});
  • 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-18T10:47:44+00:00Added an answer on June 18, 2026 at 10:47 am

    According to my knowledge , the backbone fetch() is an asynchronous event and when it completes the reset event is triggered ,

    When the models belonging to the collection (this.data) are modified , the change event is triggered, so im guessing you have not got that part correct.

    so i would do something like this :

    window.TablesInspectorView = Backbone.View.extend({
    
        tagName: "div",
    
        initialize: function () {
            console.log('Initializing window.TablesInspectorView');        
    
            // setup the tables
            this.data     = new Backbone.Collection();
            this.data.url = "../app";
            this.data.fetch();
    
            // some event binds..
            this.data.on("reset", this.render     , this); //change here
            this.data.on("add"   , this.append_item, this); // i dont see a this.data.add() in you code so assuming this was never called ?
        },
        render: function(){
            console.log("render");
            _.each(this.data.models, this.append_item);
        },
        append_item: function(item) {
            console.log("appended");
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently writing a Backbone app and have got stuck on what seems
I'm writing a backbone.js app. I have multiple js, css and html template files.
Writing a test app to emulate PIO lines, I have a very simple Python/Tk
I am writing a backbone collection which requires pagination. So this is my code
I am writing a jasmine spec against my backbone app. However, I got stuck
I'm writing an app with node.js and backbone.js. However when I try to save
I have a hover event in backbone like this: events: 'mouseover .1_select' : 'hover'
I'm currently writing a Backbone Marionette app which ultimately amounts to about 6 different
I'm writing a practice Backbone app, with Rails backend API, and I'm confused about
I'm writing a Rails 3.2 app with backbone, and since I only need rails

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.