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

backbone.js json -> template

This is my first time using backbone.js. I am trying to get a json string to parse out and populate a template I have. JSON: [ { "nav":{ "feel":"Feel Well", "eat":"Eat Well", "move":"Move Well", …
Robert
  • 815
  • 13
  • 29
0
votes
1 answer

How to remove a model from a collection that uses forEach?

I have the following piece of code initialize : function(option){ //some code this.PassedCollection = this.options.serverResponse.passedCollection; this.NewCollection = new Collection(); this.NewSectionCollection.bind("add", this.add,…
JeanFrancois
  • 134
  • 3
  • 7
0
votes
0 answers

backbone.js dry search results model and collection

I'm trying to create a dry search results model and collection for backbone so that no matter what I'm searching for in the app, we use the same model/collection and occasionally might call a different view. My Model and controller are very simple…
pedalpete
  • 21,076
  • 45
  • 128
  • 239
0
votes
1 answer

Wrapping my head around a unique backbone.js collection

I'm working out my first backbone.js app and have run into a bit of a wall. Perhaps someone can help me past this hurdle (gap in my understanding). What I want/need to do is to return the collection data to my router, so I can bind it to a Kendo UI…
Charles
  • 309
  • 1
  • 16
0
votes
1 answer

Backbone.js Collection

I am a newbie to Backbone.js. After reading a couple of tutorials as well as some documentation, I decided to try my hands on a simple blog app. The major issue I have is that I cannot seem to get my collections to display. The following is my code…
stevepop
  • 235
  • 1
  • 2
  • 12
0
votes
1 answer

Is there an event from Backbone.js Model fired when the Collection re-fetched

I have a Backbone Collection initialized by running collection.fetch() method, and then after a while, I asked the collection to fetch again in order to refresh the models. so, is there any event from Model fired that I can subscribe from View in…
Shuping
  • 5,388
  • 6
  • 43
  • 66
0
votes
2 answers

Getting 'type' of a View's model

you can access View's model from the View methods - like render() (through its model property). But let's say you have many different models and use the them with the same type of View, changing view's model property when you need. How can you…
0
votes
1 answer

Uncaught Error: Method "undefined" does not exist backbone.js:1291

Really scratching my head now. what is wrong with the following backbone.js code? It keeps complaining "Uncaught Error: Method "undefined" does not exist backbone.js:1291" Failed code is here: http://jsfiddle.net/toeinriver/ntK7r/19/ (function($){ …
lkahtz
  • 4,706
  • 8
  • 46
  • 72
0
votes
1 answer

Selecting dynamically created models within a collection

I have a set of "Person name" inputs with the class person that I'm trying to do the following with: each time a keyup is recorded in the input, grab that input's data-hash attribute, and if there's not already an instance of Person with that hash…
0
votes
2 answers

backbone.js model and collection overhead

When I fetch models or collections from the server, I am not able to access properties of the model unless I stringify then re-parse. Presumably the models themselves have some extra overhead from backbone.js? Note that in the below code I can…
goldfinger
  • 1,105
  • 1
  • 20
  • 29
0
votes
1 answer

Backbone.js Collection fetch success return

I am trying to get return from Backbone.js Collection fetch using code similar to one below. How do I bypass rest ? var myData = getCollection(); getCollection(){ this.collection = fetchCollection.fetch({ success: function(collection, data)…
Me Unagi
  • 405
  • 1
  • 8
  • 17
0
votes
1 answer

Backbone.js with collections is not working. Is it a JSON issue?

Hi all I am a neophyte in Backbone.js. I am trying to get my collections working with a RESTful python google app engine based back end. Here is the code used on the server: def getJson(): tweets_out = [] tweets = getModTweets() for…
0
votes
0 answers

Prevent API call from using cache

My Backbone web app doesn't properly reload collections from the server after logout followed by a login. It appears that this is because the associated API calls are being cached so when a new user logs in, they will see some of the previous user's…
0
votes
2 answers

How to deal with Backbone.js Collections with level-list properties

I would like to find the best way to use the following JSON (values of a signal) throught Backbone.js Model Concept : { frequency: "1/1", items: [ { value: 1, quality: 5 }, { …
Nicolas Henin
  • 3,244
  • 2
  • 21
  • 42
0
votes
1 answer

backbone.js view doesn't display results because of asynchronous fetch , doesn't render

I've noticed that my view's render function is being called 2 times. Here's my code: the View, which get's a collection: define([ 'jquery', 'underscore', 'backbone', 'mustache', 'icanhaz', 'views/spots/Spot', 'collections/Spots', …
user1271518
  • 636
  • 1
  • 9
  • 25