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

Can't set default attribute due to circular reference with Backbone-relational

I'm using Backbone with Backbone-relational. I have two models, Appointment and Client, where a Client can have many Appointments. Here's my Client model definition (in CoffeeScript): class Snip.Models.Client extends Backbone.RelationalModel …
Jason Swett
  • 43,526
  • 67
  • 220
  • 351
0
votes
1 answer

How to link backbone relational model to itself

I have simple nested JSON: { "user": { "name": "John", "related": { "name": "Alice", "related": { "name": "Bob" } } } } And I have Backbone Relational model "User": (function(){ …
Pavel Frankov
  • 172
  • 2
  • 7
0
votes
1 answer

Backbone.RelationalModel using requireJs

I would like to use RelationalModel using requireJs. Here my code(*) When I run my module, I get the following warning message: Relation=d; no model, key or relatedModel (function (){a.apply(this,arguments)}, "tasks", undefined). My questions…
Lorraine Bernard
  • 13,000
  • 23
  • 82
  • 134
0
votes
1 answer

Backbone error, Cannot read property 'c18' of undefined

I'm making a massive multi page backbone site. I'm sometimes re-using collections and views across multiple pages of the site, as if they were controls. I've now done something which is coming up with errors like this, Cannot read property 'c18' of…
Chris Barry
  • 4,564
  • 7
  • 54
  • 89
0
votes
1 answer

Why when I add data option to backbone model fetch, does it not trigger callback

I'm doing a simple fetch with a model directly in backbone. This works perfectly. model.fetch({ success: function () { alert("success"); }, error: function () { alert("error with…
Chris Barry
  • 4,564
  • 7
  • 54
  • 89
0
votes
1 answer

Responding to category model change in Backbone relational

I have a model relationship set-up with Backbone Relational, whereby an Item belongs to a Column. Adding items to columns works well, but how do I reference an existing view for an item, in-order to remove it from its old column? (Therefore, items…
joecritch
  • 1,095
  • 2
  • 10
  • 25
0
votes
2 answers

Bootstrapping data with Backbone using one query as opposed to multiple queries

Please correct me if I am wrong, but is one complex query less expensive than multiple small queries -> Question? Seems the question listed has opposing views. I was always taught that the most expensive operation is the opening and closing of the…
TYRONEMICHAEL
  • 4,174
  • 4
  • 30
  • 47
0
votes
1 answer

backbone.js populating a collection from nested array in model

Here's what I'm attempting to do: I first load a list of active site users, and each of these users is associated with a list of movies. When I click on a user, I want his list of movies to appear on the next menu over. But instead of loading the…
bento
  • 4,846
  • 8
  • 41
  • 59
0
votes
1 answer

backbone relational not updating

I have a relationship setup between my user object and my usergame object. The relationship appears to be setup correctly, i can access usergames through a user object. However, when I create a new usergame object, the user object does not…
gibo
  • 527
  • 2
  • 5
  • 22
0
votes
2 answers

Loading Backbone.Relational using Use! plugin

Backbone Relational is not an AMD compliant library, so I've gone ahead and found the use plugin to ensure underscore and backbone are both loaded as dependencies. Here is my config file require.config({ baseUrl: '../global/js', paths: { …
imrane
  • 1,542
  • 2
  • 16
  • 29
0
votes
1 answer

Destroy server model does not update id to null

after I change to Backbone-Relational my model stopped to work when I call destroy().. I have to ensure that when it removes success on server there will be no more id at client side, so then when I try to save it again my model wont request PUT…
mateusmaso
  • 7,843
  • 6
  • 41
  • 54
0
votes
1 answer

Nesting Backbone relational params for Rails Controller consumption

Normally when I use backbone.js I would apply this sort of patch to nest model attributes the way that Rails expects them: Backbone.Model.prototype.toJSON = function() { var hashWithRoot = {}; hashWithRoot[this.modelName] = this.attributes; …
Stu
  • 154
  • 1
  • 11
0
votes
1 answer

How to save elements of sub-collection with repeated ids?

The problem represented in the following code: http://jsfiddle.net/W7Rq9/ I have a collection of models (Photos). Each model (Photo) has its own collection (Tags) and sometimes the data stored in tags is repeated. And when I fetch my collection of…
evfwcqcg
  • 15,755
  • 15
  • 55
  • 72
0
votes
1 answer

Am I structuring my app the right way? - Backbone.js

I am very new to Javascript and backbone.js. Have developed an application in AS3 using RobotLegs and need to port it to Javascipt. For the client side MVC, I started looking at Backbone.js. The concepts seem straightforward but I'm a little unsure…
-1
votes
1 answer

Duplicate Username should not be allowed

I have created UI for users to create their own username and password. Username and passwords are stored in JSON format. Workflow: When user clicks on Register Button, user will be presented with UI screen with username and password input text…
1 2 3
17
18