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 model getting over-ridden after initializing backbone relation

I have a JSON response of an account based on which I'm creating ModelA which will be logged in user. JSON response as id, emailid, trackingid, gender, customurl, mobile, picture_url and plan id. Also I have a JSON response of post on which I am…
anil.n
  • 509
  • 2
  • 5
  • 17
0
votes
1 answer

Backbone/Backbone-Relational with Custom Sync

I am working on a Backbone.js app. I am also using a 3rd party API to access my data in the app. This 3rd party API does not provide the standard REST interface that Backbone expects. I have heard that I can extend or overload the Backbone.Sync…
Brian
  • 2,702
  • 5
  • 37
  • 71
0
votes
1 answer

Backbone relational fetching a model that already exists

I would like to know if there is a way to override an existing relational model after a fetch. Example: I have a method on an API that returns a random model. So I created a new instance of the model client side and performed a fetch: var x = new…
neolaser
  • 6,722
  • 18
  • 57
  • 90
0
votes
1 answer

Backbone do CRUD operations on child from parent view

Im newbie to Backbone. I have a main view which has only tabs. I want to do CRUD operations from this main view - i have CRUD buttons in the main view itself. Each tabs content is child for main view. So how can i get a reference to a particular…
Nandish
  • 125
  • 2
  • 11
0
votes
1 answer

Recursive timed XHR to fill a collection

For one of my backbone project (in which i cannot implement REST/sync), i need to refresh a backbone collection (using backbone relational as model, if it matters ?) every X seconds. What i've been doing is implement a function like this : refresh:…
Florian F.
  • 4,700
  • 26
  • 50
0
votes
2 answers

Backbone: How to get model attributes from a collection inside another model?

Model code: App.Team = Backbone.RelationalModel.extend({ urlRoot: 'data/json/team', /*urlRoot: 'data/json/myteam.txt',*/ idAttribute: 'id', relations: ... app.currentTeam = new App.Team({id:11}); View: var trophiesBox =…
Arman Ospanov
  • 143
  • 1
  • 1
  • 9
0
votes
1 answer

Backbone.js with a url to nested collections

I'm looking to build out my site using backbone.js. My API returns a url to other various resources (not strict HAL, otherwise maybe this would be ok) but I'm having a little difficulty creating aggregate pages (e.g. pages with content from multiple…
remotevision
  • 433
  • 1
  • 6
  • 14
0
votes
1 answer

Backbone-Relational: Does fetch trigger change event for all loaded relations

I did some reading and learned that fetching a collection triggers the reset event for the collection and change event for existing model that changed. In my backbone app, I fetch a collection and various relations (pages -> partials -> variables).…
Tim Baas
  • 6,035
  • 5
  • 45
  • 72
0
votes
1 answer

Backbone Relations on nested models

I am developing a project in backbone, but I believe I am mixing concepts. Basically I want to represent a model root (FRAME) which can hold objects (OBJECT) and objects may be of various types (Text, Image, Button etc). Each sub object has…
0
votes
0 answers

using Backgrid and Backbone-relational

I have a model which has HasMany items in it. var Checklist = Backbone.RelationalModel.extend( { …
eugene
  • 39,839
  • 68
  • 255
  • 489
0
votes
1 answer

BackBone Model - > Collection -> Model -> Update - does not trigger change on root model

I'm having this ServerInfoModel = Backbone.RelationalModel.extend({ relations: [ { type: Backbone.HasMany, key: 'data', relatedModel: 'Data', collectionType: 'DataCollection', …
Radu Toader
  • 1,521
  • 16
  • 23
0
votes
0 answers

Backbone.syphon infinite loop?

I'm trying to use Backbone.syphon like so: var WhoChoiceView = Marionette.ItemView.extend({ template: template, model: Model, events:{ 'click #start_add_person': 'addPerson' }, addPerson: function(){ var data =…
KingAndrew
  • 1,164
  • 4
  • 21
  • 41
0
votes
1 answer

Calling model.get() on a related model returning null values for attributes with backbone-relational

I'm currently using backbone, backbone-relational, and jQuery for a PhoneGap project that is using web-sql storage. I'm trying to pull a related model object from the parent object using Model.get('key'), but when I do that it returns a related…
activelogic
  • 1,325
  • 3
  • 14
  • 24
0
votes
1 answer

Backbone relational - how is it possible to find related model by two foreign keys?

In my model i've defined relationship, so it's property with foreign key is substituded by related model. I had an idea to give away from database two same values, for example relatedId and related - if i define models relationships for field…
avasin
  • 9,186
  • 18
  • 80
  • 127
0
votes
1 answer

Backbone relational, working with mysql data representing models as table rows

Imagine we have two tables in mysql: cars and engines. Cars table row will have following structue: id: int engineId: int (foreign key to engines.id column) brand: string Engines table row this one: id: int, type: string (imagine we have electric…
avasin
  • 9,186
  • 18
  • 80
  • 127