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 Table - Separate URLs for table structure and underlying data

I am a novice to Backbone.js. I am trying to create a UI where I have multiple tables. There are 2 separate URLs that provide data in JSON format. 1st url gives the structure of the table,i.e., the column headers, the width, a corresponding dbfield…
0
votes
1 answer

Backbone.js Model Sync claims URL Undefined

I'm trying to make a new Backbone model (working within Knockback) and I'm currently trying to set it up with a RESTful backend server. The issue is that the URL isn't accepted when trying to use the objectives.sync(). It works normally when doing…
moberemk
  • 1,597
  • 1
  • 18
  • 39
0
votes
1 answer

Show Collection Data in View In Backbone.js

I am new to backbone.js. I have 2 javascript files. 1 for collection and 1 for view. **collection.js** var colle = Backbone.Collection.extend({ initialize: function () { var data = [ { Name: "a", Image: "path1" }, {…
user1198485
0
votes
0 answers

Rendering a view on form submit (backbone.js)

I'm trying to render a view on form submit. Say I have a form, which is supposed to act as a filter. I'm rendering the form in a view and when the user hits submit, I want to re render (or perhaps render another view) with a collection of models…
avoliva
  • 3,181
  • 5
  • 23
  • 37
0
votes
2 answers

Backbone.js: Grabbing the length of a collection for use with random number

I want to grab the length of a collection to use in a random number generator. I want a view that shows one model of the collection, randomly generated. I'm using coffeescript, btw So far I've tried stuff like @collection.fetch data: id:…
0
votes
1 answer

Backbone.js render a view with a collection

I'm n00b with Backbone/Require JS and I'm trying to run a View based in a Collection. I've split the code in files following MVC pattern This is my code for the view: File: views/petDirectory define([ 'jquery', 'backbone', 'models/pet', …
0
votes
1 answer

Backbone - Accessing Model defaults through Collection in a View

Ok thaht might not be too clear. I passed a collection to my view. My collection has a Model, and the Model has defaults in an array. When I log the collection from the View it shows no length. But there are 4 defaults in my model. How can I get the…
Got The Fever Media
  • 750
  • 1
  • 9
  • 27
0
votes
2 answers

Using the initialize function in Backbone Router

I'm in the midst of creating my first backbone app using Node/express and Mongodb. The app is an online food menu and ordering system that collects all the data from mongo on the first page load and pushes it into a Backbone collection. I'm using…
0
votes
2 answers

Is it possible to pass url parameter when creating an instance of Backbone Collection object?

Is it possible to pass url parameter when creating an instance of Collection object? I would like to create an array of collections containing data for all pages. var Collection = Backbone.Collection.extend({ model: MainModel, initialize:…
hjuster
  • 3,985
  • 9
  • 34
  • 51
0
votes
1 answer

Backbone - Using fetched data inside the view

I have fatched the data to Collection variable, but I am not sure what should I do next. How to use this data and to fill the template with it? Here is my code from the render function inside the View. Collection.url = "../data"; …
hjuster
  • 3,985
  • 9
  • 34
  • 51
0
votes
1 answer

Using Remove event to detect the model removed from the collection in Backbone.js

My question is , is there a way to detect the model that got removed from the collection when we bind/listen to the collection's add Event. for ex: this.listenTo(monthsOnBoardCollection, "remove", function(){ //is it possible here to find what…
0
votes
0 answers

backbone.js for rails 3.2.13

I am using rails 3.2.13 and ruby 1.9.3 I tried to use gem "rails-backbone", '0.9.10' but it is not working properly as per REST Are there any other changes required to bo done for rails 3.2.13? I used scaffold to generate crud but REST api is not…
0
votes
1 answer

nested models with collection of itself in backbone.js

I am working on an application in Backbone.js and Jquery which requires a JSON to be like this:- { "FolderSummaryResponse": { "Status": "SUCCESS", "FolderItem": [ { "Desc": "Immediate Action Required", …
0
votes
1 answer

How can I manage an element position attributes with Backbone.js?

I have this multiplayer board game project, which has a Board (being the Collection) and many Piece objects (being the Model)*. In order to display same board set up to all online players, how can I organize my Backbone code to update the Piece's…
0
votes
3 answers

Unable to get a model in Backbone collection by CID

I have the following mode/collection/view setup in backbone. var Card = {}; //card model Card.Model = Backbone.Model.extend(); //collection Card.Collection = Backbone.Collection.extend({ url: '/api/cards', model:…
Alex
  • 1,322
  • 1
  • 20
  • 44