Questions tagged [backbone-model]

Models in the Backbone.js library.

Docs

325 questions
0
votes
1 answer

parse not being called on my model in Backbone

I am working on developing a Backbone + require app. Things are working somewhat, but after updating a model on the server, though the server is returning a 200, the 'error' function in the options hash passed to the model's 'save' is being…
garey
  • 67
  • 1
  • 9
0
votes
1 answer

comma seperated list of attributes of model's attribute from backbone

I have backbone collection with several models. I want comma separated string of one attribute of that models exist in this collection. How do I do this? any guess? later on I want filter this collection with specific attribute and then get comma…
Manish Sapkal
  • 5,591
  • 8
  • 45
  • 74
0
votes
1 answer

Cannot get data from backbone collection

I am very new to backbone and I am having a bit of trouble. So I am trying to get some data from a Model within a Collection and I cannot work out how, I am unsure if I have setup my collection incorrectly or something, but that's where I am hoping…
0
votes
0 answers

How can I handle recursive model change events with custom options in backbone.js?

I have a collection that I'm listening to all model change events on. In one specific model property, I need to set an additional value on the model, which causes the event to be fired again. I'm trying to pass in custom options so I can ignore the…
0
votes
2 answers

Validate models with Backbone.js

with help of books and tutorials im trying to do my own Todo list app. My problem is that when you add ah todo my model should validate if the input come with some text before rendering. i created the validate methis but it doesnt work and i dont…
0
votes
1 answer

Backbone.Collection.create() using Collection.url and not Model.url

I'm trying to create model objects on the fly using Backbone.Collection.create...but I note that the collection uses its url and not the model's url... Is this how it suppose to work? Can I override it on the fly just for this particular .create()?
Kendall
  • 5,065
  • 10
  • 45
  • 70
0
votes
1 answer

how to greensock tween a backbone model property

var user = Backbone.Model.extend({ defaults: { timeLeft: 0 } }); Backbone model attributes are changed with: user.set('timeLeft', 100) I need to tween this attribute with greensock. How can i tween a backbone model attribute?
user1972450
0
votes
1 answer

backbone view listenTo model object

I've a navigation view which is rendering again if the session status has changed. I want to have the same if the object user changes in the session model. But the line has no effect as the user object is not a attribute defined in the default…
0
votes
2 answers

Definition of model in frontend JS context

I usually work backend development, where a model is defined as an in-memory representation of either some database query operation or internal, pre-initialized data fields. It is processed by controller or service methods and passed to the view…
Jason
  • 11,263
  • 21
  • 87
  • 181
0
votes
2 answers

BackboneJS is unable to call functions from UnderscoreJS

I am working on installing BackboneJS in my project - and it loads fine when its referenced and loaded from the HTML page. However, when backbone API is called from my main.js, then it shows an error. The error says that its unable to access an API…
EternallyCurious
  • 2,345
  • 7
  • 47
  • 78
0
votes
2 answers

Two models in backbone View

I have been trying to display two models in one view. Here is my code: On router part- fetch models of about us and company and add them to AboutusView: var self=this; var aboutus=new Aboutus({id:1}); var company= new…
JaRoi
  • 65
  • 8
0
votes
1 answer

parse() a Backbone collection without calling the model parse()

I'm using custom parse() methods on both my base collection and base model to handle all the wrapping that my server returns around them. My problem is that the collection calls parse() on every model too which is not needed, i only need to parse on…
0
votes
2 answers

Does backbone model has any id assigned by backbone framework

Is there an id assigned to an backbone model to identify it uniquely by Backbone.js? If Yes how to access it? The situation is that I have an collection of models which is shown as an grid view having one checkbox in each row and If the checkbox ids…
0
votes
1 answer

Query on Backbone.js

I am very much new to backbone.js; What I understood from tutorials is that, backbone is tightly coupled with database ; which is in the form of models and collections on client side. Assume that, if your site is holding up per-existing RESTFUL…
Parag Diwan
  • 25
  • 1
  • 4
0
votes
1 answer

Backbone Collection: How to fetch a specific object from API to place in model

I am using a collection to fetch data from an API to place this into a model. I do receive all data from the API, however the data is returned in an object and I only need a part of this object. Let me clarify this with an example of the returned…