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
1
vote
0 answers

Algorithm-based “shadow items” in a collection as an aid to illustrate what the result will look like

I’m working on an admin interface, where admin users log in to desk content for their newspaper’s mobile app. My scenario is pretty specific, so bear with me; I have a collection of items. Items are sorted on priority (PN), set by the admin user.…
1
vote
0 answers

Using Backgrid and PageableCollection fetch method firing twice

I'm using Backgrid and Pageablecollection for pagination and each time I make a request I can see on the Network tab in Chrome Developer that the request is being fired twice, and I can't figure out why. My code looks like…
Linda Keating
  • 2,215
  • 7
  • 31
  • 63
1
vote
2 answers

Appending new data to the Backbone Relational Relation

I'm trying to design a load more type of system where every time you press load more you add data to the existing collection. This is a rough sketch of how the UI looks. Everything works pretty great except as you would except everytime I re-run the…
1
vote
1 answer

Template re-renders and doesn't display links in Backbone/Marionette - backbonerails tutorial

I am doing a http://www.backbonerails.com/ tutorial and it's a bit outdated. I am trying to render a headers.jst.eco template and which displays "BackBoneRails Demo" as a header and renders links from Backbone.Collection in list_controller.js.coffee…
1
vote
0 answers

Backgrid client side filtering is pulling data from previous as well as current data set

Backgrid client side data filtering is searching text from all data (previous and new data) and pagination data is not getting updated. It is pulling previously retrieved data. Please find following code:
1
vote
0 answers

Backbone set parse dynamically

The Backbone documentation for collections shows example where you set parse when collection is defined. var Tweets = Backbone.Collection.extend({ // The Twitter Search API returns tweets under "results". parse: function(response) { return…
Abe
  • 6,386
  • 12
  • 46
  • 75
1
vote
1 answer

Backbone Performance - Collection with a view per model or only one view for the whole collection

If a have a collection with 50 models, it seems that I have 2 main options to render a list displaying 50 models: - Option1 : Create a specific "item view" for each model and append these views to a main "list view". This will provide a direct…
1
vote
1 answer

Sum Backbone Collection

I've already read some topics here in stackoverflow, but I didn't found a solution to my problem... I want do the sum of 'progress' field in all my models into a collection... So in my collection file I have: progressTotal: -> total =…
1
vote
2 answers

Moving Models from One collection to another [BackboneJS]

Imagine I need to create a Single page application like Gmail, using BackboneJS. Whenever a mail item is tagged with new labels/ removed the existing labels, the mail item should appear in the appropriate list. I assume every list of e-mails, like…
Kumaran
  • 41
  • 4
1
vote
0 answers

How do you know when all the item views in a collection view have been rendered?

I have a backbone.js/Chaplin app with the following flow: Collection view instantiated with a collection Collection is fetched from the server On sync of the collection render an "item view" for each model inside of the the collection view. This…
Rupert
  • 1,629
  • 11
  • 23
1
vote
0 answers

Merging duplicate models in my collection but adding the quantity

I have items that are stored as models through an add to cart button. The model has: Name Quantity Item_ID But it will not store duplicate items. If someone clicks on the add to cart button again I want the collection to merge the 2 models…
1
vote
1 answer

Unable to set initial collection data in Backbone.localStorage plugin

I'm using Backbone.localStorage and have the following Collection: var PlayersCollection = Backbone.Collection.extend({ model: Player, localStorage: new Backbone.LocalStorage("players-backbone"), }); and trying to set initial data by using:…
Erik
  • 14,060
  • 49
  • 132
  • 218
1
vote
2 answers

Backbone.js - get view, model or collection property in ajax 'beforeSend'

I am using Backbone.js in my node app. I am calling various ajax call from views, models and colllection. I have created my custom property e.g. "myName" in every view, model and collection and assigned with unique name for each. Now I want this…
1
vote
3 answers

Backbone.js What is the purpose of specifying a model in collection

Here is what I am trying to understand. Often times I find myself writing backbone like this: var CallModel = Backbone.Model.extend({ }); var CallsCollection = Backbone.Collection.extend({ model: CallModel, url:…
1
vote
1 answer

Backbone order collection alphabetically

I am working on a backbone application at the moment, and I wanting to order my collection based on various attributes, I have sorting working based on cost, duration, start and finish date (timestamps) but I am struggling to sort the collection…
Udders
  • 6,914
  • 24
  • 102
  • 194