Questions tagged [backbone-relational]

Get and set relations (one-to-one, one-to-many, many-to-one) for Backbone models.

Get and set relations (one-to-one, one-to-many, many-to-one) for Backbone models.

Resources:

256 questions
0
votes
1 answer

backbone view asks for a model Im not using

I have a user model, each user has an artist and every artist has several albums. I'm trying to render a view to show a user profile. When I try to render the view I get the following error: Uncaught ReferenceError: albums is not defined (anonymous…
Nocturn
  • 321
  • 6
  • 13
0
votes
1 answer

Exposing relational models to backgrid.js

I want to expose some attributes from relational model (builded via backbone-relational) to my backgrid (builded via backgrid.js). As I understand backgrid receives collection and mapped model as columns object. So I need to change model when the…
Integral
  • 115
  • 1
  • 8
0
votes
1 answer

Top level collection of a Backbone.js model won't sort

I'm working on my first Backbone.js app and have run into some weird behavior that I'm concerned could indicate a problem in my design. My data looks like this: Syllabus Dance Figure Figure Figure Dance …
0
votes
1 answer

Nested Model In backbone is filled with data

I created a model(RuleModel) and which has a attribute which is other model(RuleInformationModel) . But while passing the json(SampleRule) the data the internal model is not getting filled. When i do console iam getting undefined. So i checked in…
0
votes
1 answer

Is there a restful way to tell Backbone to save only one attribute to the server?

I have a collection that's attached to a model. When I click a button, I would like to be able to tell backbone to save only that one attribute (containing the collection) to the server m.Survey = m.BaseModel.extend({ relations: [{ type:…
Toli
  • 5,547
  • 8
  • 36
  • 56
0
votes
1 answer

How to delete a dependent model from the same collection in backbone.js

I have a model which has both navid and subnavid .While destroying a model i need to check in the entire collection , for other models which have navid as same as subnavid of the model i'am trying to delete . Please help me out . Thanks in advance .…
0
votes
1 answer

Send BackboneRelational as ajax data

I have a model that extends Backbone.RelationalModel and that has a one to many relation, the problem occurs when I try to send an ajax request with that model as the parameter. $.ajax( url: 'save' type: 'POST' data: …
Khaled
  • 2,101
  • 1
  • 18
  • 26
0
votes
1 answer

Backbone success callback not called

I am having an issue trying to get called a success callback after fetching a collection. Here is the code from the collection, the problem is excuting executeLongPolling (function() { window.StatusCollection = Backbone.Collection.extend({ …
Markinhos
  • 736
  • 1
  • 6
  • 13
0
votes
1 answer

In Relational Backbone, when is the right time to intercept the response from server before creating a model?

I have a pretty complicated Backbone Model structure. m.Question: is a base question. If this was C++ it would be an "abstract" model because only it's children are ever instantiated m.NumericQuestion: extends m.Question m.MultipleChoiceQuestion:…
Toli
  • 5,547
  • 8
  • 36
  • 56
0
votes
1 answer

How to avoid using Backbone-relational, a simple blog backbone app with comments relating to posts

Backbone relational is too messy for me and I can't seem to debug it. I am trying to avoid using this asset. I have two collections in my Backbone app. Voice.Collections.Posts and Voice.Collections.Comments This is my router: class…
0
votes
1 answer

Backbone Relational: remove event not fired

I'm trying to setup a little pair of models with Backbone Relational but I don't understand how the remove event is fired. Here's my models code: var Car = Backbone.RelationalModel.extend({ idAttribute: "id" }); var Cars =…
Ingro
  • 2,841
  • 5
  • 26
  • 42
0
votes
1 answer

Passing the model's attribute to collectionOptions

How can i pass the model's attribute to collectionOptions? When i try to pass param0 like that, then this is referenced to window instead to MyModel instance: var MyModel = Backbone.RelationalModel.extend({ defaults: { param0: null, …
mumu2
  • 661
  • 1
  • 5
  • 15
0
votes
1 answer

Backbone-Relational: Fetch returns generic JS object

In the following code, I establish 3 has-many/belongs-to relations. Category > Subcategories > Items Category.js.coffee: class App.Models.Category extends Backbone.RelationalModel relations: [{ type: Backbone.HasMany key:…
pws5068
  • 2,224
  • 4
  • 35
  • 49
0
votes
1 answer

Backbone.Collection.each - Very strange behaviour

I'm currently experiencing very unusual behavior when using the each method of a Backbone collection. In my app, I allow users to edit existing models, which includes editing and adding a number of time constraints to that model. The model and its…
Richard Stokes
  • 3,532
  • 7
  • 41
  • 57
0
votes
1 answer

Backbone.relational, real-time and handling large data

I'm building a real-time feed application using Backbone.js, node.js and socket.io. My Feed is a collection of Update models. Displaying these, overriding Backbone.sync for integration with socket.io works fine. The complication comes in that each…
JamieNewman
  • 917
  • 1
  • 12
  • 20