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

Inverting the data structure using backbone relational

I'm using backbone-relational to write an app using nested data. The top level of the data structure contains most of the data (in terms of MB) but is never used as a standalone item; it's only used to flesh out the attributes of its related…
wheresrhys
  • 22,558
  • 19
  • 94
  • 162
0
votes
1 answer

relational models and variable references within templates using backbone and marionette

I'm messing around with backbone, marionnette, and wondering how I should be dealing with relational models. My main reason is i'd like to be able to use data in two different related models in the same template. e.g. Thing =…
Devin McQueeney
  • 1,277
  • 2
  • 14
  • 31
0
votes
1 answer

How to set relational attributes on new model with Backbone-relational

I am building a JavaScript app, and have been learning JavaScript and Backbone, and have added Backbone-relational to it. It saves to a Django-tastypie REST server. So before I was using Backbone-relational, I would create a new object, and either…
wobbily_col
  • 11,390
  • 12
  • 62
  • 86
0
votes
1 answer

Backbone update nested collection with ids. (Rails Backend)

I have a model appointment which has many tasks. Creating a new appointment model which has tasks works fine with backbone. But when i try to update the model with the ids of different tasks it is not working. I get the following…
Ben
  • 2,560
  • 4
  • 29
  • 43
0
votes
1 answer

Backbone JS: Routes with empty parameters

I have a route. routes: { "example/=q:query": "example_main" } This: localhost/site/#example/q=hello works perfectly but if the URL is: localhost/site/#example/q= My router does not understand it and no action is performed. Does anyone know…
0
votes
1 answer

Backbone view inside other view by ajax. Events not working

I have Backbone view. It load content (component on backbone with AJAX): render: function () { var self = this; $.get('/Blog', request, function (data) { self.$el.html(data); …
0
votes
1 answer

Does backbone-relational need a backend?

Experimenting with backbone-relational; I'm using Indexeddb to store all my data, is it possible to use backbone-relational without a backend and just let it talk to Indexeddb? Thanks in advance, James
user179169
0
votes
2 answers

Backbone-relational change event not firing?

I'm stumped on this. I have a simple backbone-relational model: window.Site = Backbone.RelationalModel.extend({ idAttribute: "_id", // These are the relations to the user model. relations: [{ type: Backbone.HasMany, key:…
CamelBlues
  • 3,444
  • 5
  • 29
  • 37
0
votes
2 answers

Can't get Backbone-relational to work with AMD (RequireJS)

I have the following Backbone router definition in CoffeeScript: // appointments_router.js.coffee define ["app", "appointment"], (App) -> class Snip.Routers.AppointmentsRouter extends Backbone.Router initialize: (options) -> …
Jason Swett
  • 43,526
  • 67
  • 220
  • 351
0
votes
1 answer

Using the same backbone relational models to work with both pre-loading and ad-hoc loading of data

I have a tree of models and I'd like to have them load from one big JSON request up front and then be able to change them one at a time without saving the whole tree or reloading the whole tree and without making two versions of each model. The…
mortea
  • 16
  • 3
0
votes
1 answer

Backbone js code smell - better way to embed a sub-view?

I'm building a backbone app using backbone-relational models (but that shouldn't matter for this question). Basically, I have an edit button that will display a hidden div. Inside the hidden div id a sub-view (called DetailsView) that renders table…
CamelBlues
  • 3,444
  • 5
  • 29
  • 37
0
votes
3 answers

Backbone.js - Customize the organization of data returned from "fetch()"

What is a good way to go about customizing the server's response after a call to a model's fetch()? The reason I ask is because I'm dealing with a situation where a model has several child models. The data returned from the server needs to be split…
Chris Dutrow
  • 48,402
  • 65
  • 188
  • 258
0
votes
1 answer

Backbone.js - nested models & more then one model in collection?

Can one have nested models in backbone.js? Example: Model A has one of its attributes as Model B Can one store more then one model type in collection?
Nilesh Kale
  • 233
  • 1
  • 4
  • 12
0
votes
1 answer

How to get information from a view to a model in Backbone.js without a DOM event

I'm new to Backbone.js and am having trouble figuring out the proper architecture for a model-view relationship. I have a view that holds an input box and a model that is supposed to take the contents of that input box and send it to the server. My…
Chris Dutrow
  • 48,402
  • 65
  • 188
  • 258
0
votes
3 answers

BackboneJS catch event OnAdd from initial load

I'm creating a collection without using fectch(), but with JSON data already available. this.displays = new Displays(jQuery.parseJSON($('#temp_json').html())); I need for each model of that collections to have a 'position' value setup, which should…
LEM01
  • 871
  • 3
  • 15
  • 23