FAQ Database Discussion Community


Backbone.Model destroy does not includes model ID in url

javascript,backbone.js,backbone-model
I want to use a delete method for my backbone model but for some reason, backbone does not include that model ID in produced request URL. To remove my model, i need to fire a following request: DELETE /api/v1/places/12/place_users/12. Here is my code: # place_user.model.js var PlaceUserModel = Backbone.Model.extend({ url:...

Backbone JS - Combination of collection, views and models

backbone.js,backbone-views,backbone-collections,backbone-model
I had the following setup now in three different projects, so I thought maybe it's worth asking here. There's a chance I'm not the only guy wondering about this. So there it comes: I have a list of objects The list items have a special function like draggable or onClick-Events...

Backbone view listening to model, not firing on change or reset?

backbone.js,backbone-views,backbone-events,backbone-model
I am using a model to fetch location data from a service using POST. However I am struggling to get the view to listen to that model when it finally receives a response. Note I have overriden some model methods to fit the service I am using. Model code define([...

Backbone model which I see in success callback and error callback is different. #Backbone save

backbone.js,jquery-callback,backbone-collections,backbone-model
I have a backbone model which has Backbone Collections in it. When I save the model and if it is success then my model object is properly structured as it was. But when error occurs (say validation error), in error callback the model object is modified (Collections inside model object...

Backbone Performance - Collection with a view per model or only one view for the whole collection

performance,backbone.js,backbone-views,backbone-collections,backbone-model
If a have a collection with 50 models, it seems that I have 2 main options to render a list displaying 50 models: - Option1 : Create a specific "item view" for each model and append these views to a main "list view". This will provide a direct relationship between...

Error retrieving models from backbone collections once there is idAttribute = '_id'

backbone.js,backbone-collections,backbone-model
I have a Model user set to be like this: User = Backbone.Model.extend({ urlRoot: '/users', defaults: { id: '', username: '', password: '' }, idAttribute: '_id', initialize: function () { console.log('User initiated'); } }); And Collection to be like this: var Users = Backbone.Collection.extend({ url: "/users", model: User, }); Users...