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
1
vote
2 answers

backbonejs - fetching multiple model

i'm novice in backbonejs and i'm doing some project that includes fetching and displaying friends list. for this project i'm using parse.com as database. but i'm stocked at this point. for example: i have following data's in user and friends…
1
vote
1 answer

Uncaught TypeError: Cannot read property 'idAttribute' of undefined

I am using Backbone-Relational, and I recieve the following error: Uncaught TypeError: Cannot read property 'idAttribute' of undefined When I access the show_note route. App.Router = Backbone.Router.extend({ routes: { 'note/:_id':…
Evan Emolo
  • 1,660
  • 4
  • 28
  • 44
1
vote
2 answers

Can I use this callback result with Backbone?

I hope someone can help me as Ive been trying for well over a week to see if I can use this callback result to populate a Backbone model/Collection. Specifically, I want to list the Area Name and the AreaGUID - I also want to get the total price…
1
vote
1 answer

Creating Relationships in BackboneJS / Accessing Parent Attributes in Backbone Relational

I am using Backbone Relational to handle relationships between two models that I have. Here are the two models that I have: Thread = Backbone.RelationalModel.extend({ urlRoot: '/api/thread', idAttribute: '_id', relations: [{ type:…
1
vote
1 answer

How to fetch nested collection in Backbone-Relational

I am trying to fetch all clients, who have nested client-contacs (people). I am having some trouble getting the client-contact collection who belongs to the client/company. If I try to get the collection I get nothing. BTW, I am new at backbone and…
tomasbarrios
  • 813
  • 9
  • 15
1
vote
1 answer

Rendering nested collections using Backbone.Marionette and Backbone.Relational

I'm trying to make a simple calendar/todo-list with Backbone.js. I have a collection of Days that can each have multiple Todos. I would like to render each date into an unordered list containing itself an unordered list of todos. Here is my HTML…
Lukmo
  • 1,688
  • 5
  • 20
  • 31
1
vote
1 answer

loading backbone and backbone relational with require js

Hi all Im trying to load backbone and backbone-relational in require js every time I just require 'backbone', this is my code: main.js: requirejs.config({ paths: { 'domReady': 'lib/require/domReady', 'text': 'lib/require/text', …
Kev
  • 705
  • 1
  • 5
  • 10
1
vote
1 answer

backbone fires 'add' event after 'sort' on backbone.relational collection

I'll try to explain my problem in detail, but if something's missing, please poke me and I'll gladly give you additional info.. I'm using backbone 0.9.10, backbone-relational 0.7.1, underscore 1.4.4. I've setup a backbone relational collection like…
1
vote
1 answer

Send a POST ajax to add products to quotation

My background is more server-side than front-end. So I may be lacking in some basic front-end knowledge. I have a endpoint called /quotations/:id/products which if you do a POST action, this means you want to add products to the specified quotation…
Kim Stacks
  • 10,202
  • 35
  • 151
  • 282
1
vote
0 answers

backbone relational : Uncaught TypeError: Cannot read property 'id' of null

I'm having a problem trying to implement the backbone relational within our application. I get this error after i try to fetch a RelationalModel: Uncaught TypeError: Cannot read property 'id' of null This is the module App.Models.Story =…
1
vote
0 answers

Using Backbone Relational+Mongoose, how do I RESTfully save a collection that's an attribute of a model?

In backbone, I have a model with the following structure: m.Survey = m.BaseModel.extend({ initialize: function() { this.saveInvites = _.debounce(this.saveInvites, 1000); }, /** * What should this function…
Toli
  • 5,547
  • 8
  • 36
  • 56
1
vote
0 answers

Using Backbone Relational, how to Store Array of Object IDs in Mongoose, Retrieve as Objects, Save Back as IDs

Here's my situation: I have a Mongo Database with the following schemas: var SurveySchema = new Schema({ start_date: Date, end_date: Date, title: String, questions: [ObjectId] //this I want to refer to questions }); var…
Toli
  • 5,547
  • 8
  • 36
  • 56
1
vote
0 answers

backbone fetchRelated without full=True gives only IDs and URIs

I have the following tastypie resources: class ArtistResource(SearchableResource): audio_tracks = fields.ToManyField('music.api.AudioTrackResource', 'audio_tracks', related_name='artists', null=True, blank=True) class Meta: …
Feanor
  • 3,568
  • 5
  • 29
  • 49
1
vote
0 answers

Remove event not occuring in backbone relational collection

The below code is in a Backbone.View within the render function. I am using Backbone.Relational and jQuery UI Sortable. var scopedThis = this; // make this container a sortable container this.$el.sortable({ connectWith:…
Rick
  • 61
  • 1
  • 4
1
vote
1 answer

Backbone Relational: relation lost during saving

Today I updated backbone.js (0.9.2 => 0.9.9) and backbone-relational (0.5.0 => 0.7.0), and a piece of code stopped working and I can't figure our why. (I even tried to upgrade step by step (e.g. backbone-relational 0.5.0 => 0.6.0), but that didn't…
lacco
  • 882
  • 1
  • 10
  • 24