Questions tagged [backbone.js-collections]

For Backbone questions specific to Backbone's collections.

Backbone collections are order sets of models. Collections forward events on their models to the collection's listeners for convenience.

523 questions
0
votes
1 answer

can't fetch properly collection using backbone.js

Please read till the end (i make a reference to console.log at the end) the model: // Spot model: define([ 'jquery', 'underscore', 'backbone' ], function($, _, Backbone){ var Spot = Backbone.Model.extend({ url: function(){ …
user1271518
  • 636
  • 1
  • 9
  • 25
0
votes
1 answer

backbone.js infinite pagination display issue

I'm using backbone infinite pagination. Take a look at this image. Before I click "more" everything is ok. Once I click "more" then new results are added fine, but the "more button" is not pushed down. this is my template (I use twitter bootstrap),…
Yaron Naveh
  • 23,560
  • 32
  • 103
  • 158
0
votes
2 answers

Backbone reset event bound to collection not firing when collection is loaded with data

I am new to Backbone and started by working through the Todos example. After that I created a new version of the example, for Contacts rather than Todos, that uses a Ruby on Rails web app and and it's associated REST API rather than localstorage…
markjm
  • 23
  • 1
  • 4
0
votes
1 answer

can't iterate over backbone collection, could be a fetch/bind issue

I'm grabbing a list of a users friends, into a collection, and I want to iterate over those friends so that the user can select a friend and do a bunch of stuff later. in my initalize I've got friends = new…
pedalpete
  • 21,076
  • 45
  • 128
  • 239
0
votes
1 answer

Adding Models to Backbone.js Collection Silently Fails

I am implementing a Blog Engine as a learning exercise for a new job. I have a Backbone.js Collection class called BlogList that is composed of BlogModel objects (a BlogModel is a single post to a blog). I have a masterBlogList that keeps all blog…
Sam
  • 81
  • 2
  • 7
0
votes
1 answer

Chrome extension converting backbone.js collections to regular JavaScript array

In my background script: var collection = Backbone.Collection.extend({}); chrome.extension.onRequest.addListener(function(request, sender, sendResponse) { sendResponse(new collection()); } In my browser_action's…
jlb
  • 19,090
  • 8
  • 34
  • 65
-1
votes
1 answer

How to properly reverse sort a BackboneJs collection?

I have a table where several items are displayed. ... ...
Priority
The priorities holds an integer…
-1
votes
1 answer

Will backbonejs model cid be unique across multiple collection?

I want to know that will backbone model cid will unique among multiple collection. Example: I have pageCollection and each pageCollection will contains another collection called controlCollection. If I am creating control model, its cid will be…
No one
  • 1,130
  • 1
  • 11
  • 21
-1
votes
1 answer

backbone js getByCid not working

The backbone getByCid is not working when i viewed in console.log it showing the error as TypeError: test.getByCid is not a function. By using at(0).cid it shows the output as 'c1' why its not working. var test=new Backbone.Collection([ …
GGSankar
  • 29
  • 8
-1
votes
2 answers

Uncaught ReferenceError: models is not defined in the html file in a backbone.js application

demo.js var CommentsCollection = Backbone.Collection.extend({ url : "http://0.0.0.0:8080/" }); var CommentsListView = Backbone.View.extend({ el: '.page', render : function(){ var that = this; var commentsCollection…
-1
votes
1 answer

Advice on structuring Backbone array data

I'm in the middle of a process where I'm retrieving data from a REST API for use in my Backbone.js application. At this point I don't need to do any manipulations to the data except for the fact that the data returned is an array. However, the…
-1
votes
2 answers

On and Off event doesn't work well

I create my view with a new collection. I fire add and sync events : this.mapDetailsCOllection.on('add', self.onAddElement, self); this.mapDetailsCOllection.on('sync', self.onSync, self); Before fetch I do…
-1
votes
1 answer

Backbone collection: add logic to item models

I update a Backbone collection from array of bare objects by using reset: const collection = new Backbone.Collection(); // ... const switches = [ { color: "red", on: false }, { color: "green", on: false }, { color: "blue", on: true…
Mikhail Batcer
  • 1,938
  • 7
  • 37
  • 57
-1
votes
1 answer

Slow responce whie parsing large JSON responce

I have developed a web application based on RESTFul design where the application takes JSON responce from JAVA based web service and displays in UI and it refreshes the data in every 5 seconds. The application uses Bootstrap for UI design, Backbone…
-1
votes
1 answer

Backbone collection could save bulk of model through passing in url array of object

I have written Post API that can accept Array of objects like [{"name":"ABC","city":"Banglo"},{"name":"AC","city":"Newyork"},{"name":"C","city":"Mumbai"}] in Java using the Dropwizard framework. Now I'm trying to call these API method through…
1 2 3
34
35