Models in the Backbone.js library.
Questions tagged [backbone-model]
325 questions
0
votes
2 answers
backbone model saving and callback issues
I just start using Backbone. I have two questions to ask based on the code below.
The first issue is after I fill out the form and click the button, the model object should be created with some default attributes. However, the console.log prints…

eded
- 3,778
- 8
- 28
- 42
0
votes
1 answer
Backbone looping through and getting value from nested collection
I have a problem accessing nested values in my backbone collection. So far i've managed to get out some values. Here is the html and javascript code aswell as my result:
Code: http://jsfiddle.net/mM2Mk/4/
Result:…

Mati Kowa
- 69
- 1
- 2
- 4
0
votes
1 answer
Backbone Fetching Process
I have Backbone Model that collect data from server:
Job.Models.Response = Backbone.Model.extend({
defaults: {
'authStatus': false,
'id': '1',
'name': 'name',
},
urlRoot: '/static/js/public/json/'
});
I have button…

Kirill Kaysarov
- 13
- 8
0
votes
1 answer
Detecting changes on Backbone Model without distinct view
I have a model in which I am using in multiple views. I want to detect a change event on that model (save it to localStorage for persistent) but I want the change to be independent of each view.
Is there a way to bind a model change event on the…

streetlight
- 5,968
- 13
- 62
- 101
0
votes
1 answer
Backbone: Creating models from a Collection of Models that contain a Collection of Models
I have an API that is producing GeoJSON data of a number of Venues and Events that are occurring at each Venue.
See an example output:
{
"crs":null,
"type":"FeatureCollection",
"features":[
{
"geometry":{
…

alukach
- 5,921
- 3
- 39
- 40
0
votes
1 answer
nested models with collection of itself in backbone.js
I am working on an application in Backbone.js and Jquery which requires a JSON to be like this:-
{
"FolderSummaryResponse": {
"Status": "SUCCESS",
"FolderItem": [
{
"Desc": "Immediate Action Required",
…

ashwin74268
- 3
- 2
0
votes
1 answer
How can I manage an element position attributes with Backbone.js?
I have this multiplayer board game project, which has a Board (being the Collection) and many Piece objects (being the Model)*.
In order to display same board set up to all online players, how can I organize my Backbone code to update the Piece's…

tilacog
- 663
- 7
- 14
0
votes
3 answers
How to share and bind Model with the Views in Backbone.js
I'm new at Backbone.js. So I want to ask a question about problem which I face with.
I have a User object which is exteded from Backbone.Model. According to the state of this object( authenticated or not), I want to change my views. I have showView…

ibrahimyilmaz
- 18,331
- 13
- 61
- 80
0
votes
1 answer
Do I need to use models when inserting a new record to a db?
I'm writing a simple web app that requires a poll - using Backbone which interfaces with a RESTful Node API and a Mongo DB.
The premise is simple: there are 5 topics, the web user can select one and lodge a vote. This will insert a document into…

HankHendrix
- 295
- 2
- 9
0
votes
1 answer
Nested Model In backbone is filled with data
I created a model(RuleModel) and which has a attribute which is other model(RuleInformationModel) . But while passing the json(SampleRule) the data the internal model is not getting filled.
When i do console iam getting undefined. So i checked in…

Arun Kumar
- 3
- 3
0
votes
1 answer
Parsing model data in Backbonejs that includes sub-models
I am using Backbonejs to build an in-dash vehicle application. Some of my models persist back to a server using HTTP, and others persist to the local file system only accessible through the framework's read/write functions.
My question is…

Danny
- 3,615
- 6
- 43
- 58
0
votes
2 answers
Overriding Backbonejs model fetch function
I am using Backbonejs to build an app for a vehicle head unit. I wish to persist some of my models using the framework's read/write functions rather than using HTTP requests.
Looking at the documentation for the fetch method at backbonejs.org, not…

Danny
- 3,615
- 6
- 43
- 58
0
votes
1 answer
Backbone.js - Collection within Model - Object function (a){return new n(a)} has no method 'has'
I am getting an
Object function (a){return new n(a)} has no method 'has'
error on calling the fetch() method on my model. Heres the code:
var Exercise = Backbone.Model.extend({
defaults: {
idAttribute: 'e_id',
e_id: "-1",
…

user1151659
- 132
- 11
0
votes
1 answer
Don't call render() if the View itself updated Model via Backbone.Model.set()
In my Backbone.js project I have one Model and several Views. All Views have registered callbacks for 'change:currentTextTitle' on this model:
// 'this' stands for any of the Views here
myModel.on('change:currentTextTitle', this.render, this);
Now…

nachtigall
- 2,447
- 2
- 27
- 35
0
votes
2 answers
how to unset an _id backbone model attribute?
I would like to unset() the _id attribute from an instance of a model, to make a POST request using the save() model method.
But i get a Uncaught TypeError: Object [object Object] has no method 'call' backbone-min.js because of this…

Ludo
- 5,060
- 15
- 53
- 85