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

creating nested structure with backbone-relational

I'm trying to create a three cascading dropdown lists. First one constains projects, second contains tasks for selected project and the last one sites for selected task. I want to use the Backbone-Relational plugin, but have hard time to create the…
lkurylo
  • 1,621
  • 33
  • 59
0
votes
1 answer

How to use Webpack ProvidePlugin to load Backbone-relational right?

I have defined webpack ProvidePlugin to load Backbone-relational library as follows. plugins: [ new webpack.ProvidePlugin({ $ : "jquery", Backbone : "backbone", _ : "underscore", "Backbone.Relational":…
0
votes
1 answer

Backbone relational one to one relation, how to get parent's model data?

exampleData = { id: 1, name: 'A', house: { address1: 'California' address2: 'California' } } House = Backbone.RelationalModel.extend({ urlRoot: function urlRoot() { var personId = this.get('person').id;…
Expert wanna be
  • 10,218
  • 26
  • 105
  • 158
0
votes
1 answer

Backbone model getting back old values of models of collection after setting them to new values

Here is the part of Schedule collection in backbonejs application: App.Schedule = App.Games.extend({ /* url: 'data/json/server/schedules.json' */ url: '../rest/schedule', initialize: function() { var self = this; …
maximus
  • 4,201
  • 15
  • 64
  • 117
0
votes
2 answers

What is the best way to destroy related models when a model is destroyed in backbone relational?

I have complex nested structure of backbone relational models. Every time I destroy a model, it is expected that the all models from relation are destroyed. How do I do it? Apparantely Backbone-Relational does not take care of it.
Pratik
  • 695
  • 2
  • 11
  • 29
0
votes
0 answers

backbone relational variable parent

I'm looking to properly architect my backbone models using backbone relational and wanted to know if this is the proper way to do this. I want to have a model Reviewable that can either have a parent of Photo or Video. Essentially each photo or…
0
votes
0 answers

How to save all changes in Backbone.js models and collection by click "Save" button?

I use things that are listed in the tags. I have some model with many different relations. The relations of model can be deleted or added(resource created) by user. And I wanna save all changes in the main model and any relations update. By…
SakuradaJun
  • 123
  • 1
  • 6
0
votes
1 answer

how can I have CollectionView of CollectionView in marionette.js?

I have a use case where I want to have a collection of collectionViews (or composite views) rendered. What is the best way to do this using marionette.js? My model structure is as follows- A | |-- Collection | …
Pratik
  • 695
  • 2
  • 11
  • 29
0
votes
2 answers

Backbone-relational parsing nested models

I thought backbone-relational automatically parses and makes nested models ready of nested json. I have a big json like this { //ItemResultModel "items":[ { //ItemModel "id":120514, …
omeralper
  • 9,804
  • 2
  • 19
  • 27
0
votes
0 answers

BackboneRelational issue with MarionetteCollectionView

Currently, we are using nested attributes that are getting saved in the collection view being sent back to the server. For some reason, Marionette creates the new view in the collection just fine, but then it goes through the collection,…
user3000847
  • 191
  • 1
  • 2
  • 11
0
votes
0 answers

How to create a default, empty, has-one relation in Backbone-relational?

I'm using Backbone-Relational in my project, and I have a model with another nested model in a HasOne relation. I required the nested-model in my client-side even if it doesn't exist in my server. If my server sends the nested modal data everything…
ShayDavidson
  • 717
  • 1
  • 7
  • 20
0
votes
1 answer

Does Backbone Relational have problems when two separate (but "related") collections contain models with identical Ids?

I'm using Backbone.js, Marionette.js and Backbone-relational on a page that displays lists of users. Each user is identified as either "pending" or "active." A "pending" user is one that has been sent an invitation to join (the party) but has not…
Miguel Valencia
  • 221
  • 3
  • 14
0
votes
0 answers

Backbone.relational losing reference to submodels after save

I'm using backbone relational and have a big app with a lot of nested models. let's say that we have a backbone relational model "bar" that have a has_many relation to a "foo" model. The problem is that when i'm using sub views that way : new…
0
votes
1 answer

TypeError: set is undefined in backbone-relational

Strange error on index page load using backbone-relational in rails TypeError: set is undefined Here is part of backbone-relational.js source. Error is pointing on line 1931: 1891: var set = Backbone.Collection.prototype.__set =…
GriwMF
  • 279
  • 2
  • 10
0
votes
0 answers

Backbone-Relational doesn't work through ajax

Backbone-relation does not work when BackboneCollection takes data from uri, but when BackboneCollection takes data from javascript object - all right. does not works when var rows = new Rows(); rows.fetch(); but works if: var Data = [{id: 1,…
vihtor
  • 265
  • 2
  • 10