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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:37:48+00:00 2026-06-01T06:37:48+00:00

My collection.fetch doesn’t work and doesn’t get the models to be rendered. I have

  • 0

My collection.fetch doesn’t work and doesn’t get the models to be rendered.
I have this on my router.js

itemcollection = new ItemCollection();
        itemcollection.fetch();
        ItemListView.render();
        CartListView.render();
    }

my itemcollection.js

define([
'underscore',
'backbone',
'model/item_model'
  ],function(_, Backbone, Item){
var ItemCollection = Backbone.Collection.extend({
    model: Item,
    url: 'http://posbeta.interprisesolutions.com/POSMobileConnector/Product/loaditembycategory/Event Materials',
    parse: function(response) {
    return response.Items;
  }
});
return ItemCollection;
});

my view:

initialize: function(){
  ItemCollection.bind("reset", this.render );
},
render: function(){
  var data = {
    items: itemcollection.models
  }
  var compiledTemplate = _.template( ItemListTemplate , data);
  $("#itemContainer").html( compiledTemplate );

},

The funny thing is when i debug it using firebug it renders properly when i remove the breakpoint it doesn’t display anything. any ideas?

  • 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-01T06:37:49+00:00Added an answer on June 1, 2026 at 6:37 am

    Bear in mind that fetch is asynchronous – it returns immediately, before the data has been loaded.

    You could try something like:

    itemcollection = new ItemCollection();
    itemcollection.fetch({
      success: function () {
        ItemListView.render();
        CartListView.render();
      }
    });
    

    Alternatively, you could listen on the collection’s reset event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I create a new collection, fetch is called automatically once. This gives me
I have a view that's doing a fetch() to a collection and returning some
Using Backbone I can fetch the Collection like below and render a Backbone View
Garbage Collection can become a time consuming process. In this regard, the GC tends
I have a collection of objects to which I'd like to just add a
I have a collection of classes that inherit from an abstract class I created.
I'm designing this collection of classes and abstract (MustInherit) classes… This is the database
If I have a collection of database tables (in an Access file, for example)
In my current project, I have two models, Version and Comment. There is a
So far i have the following code, but it doesn't seem to be working,

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.