Skip to main content

Questions tagged [backbone.js-collections]

For Backbone questions specific to Backbone's collections.

backbone.js-collections
0 votes
2 answers
53 views

I am trying to sort my collection when I add a new object to it, but it is not sorting and there are no errors

in my Backbone view, a user can add a new educational research opportunity by hitting a button. Each research opportunity has a sequence in the database and this is how it's ordered on my page. When I ...
SkyeBoniwell's user avatar
  • 6,903
0 votes
2 answers
33 views

How can I tell my javascript to wait until the server is done?

In my web app, I have a page where users can copy books from their library. On the website, when a user clicks the copy button, the app executes this bit of Backbone.js code: clonebook: function () { ...
SkyeBoniwell's user avatar
  • 6,903
-1 votes
1 answer
62 views

How to properly reverse sort a BackboneJs collection?

I have a table where several items are displayed. <table> ... <th scope="col">Priority <a id="sort"><i class="fas fa-chevron-down"></i></...
CodeGirl's user avatar
1 vote
0 answers
137 views

show local json data from collection in backbone.js

I have a local json file. I need to put these data in a Backbone.Collection, then receive this collection in a Backbone.View and render the data in a template. So I tried many ways but... Model: ...
ALi Hz's user avatar
  • 25
1 vote
1 answer
46 views

Populating data from two different url in a backbone collection

I have a Marionette.LayoutView which calls a backbone collection and fetches the data and renders based on response. Now the issue that I am facing is, this collection needs to get data from two ...
adarsh723's user avatar
  • 135
0 votes
1 answer
47 views

Why is my backbone.js collection not loading the correct list of data?

Here is my model and collection definition: let PhotoModel = Backbone.Model.extend({ urlRoot: '/api/Photo', defaults: { id: "2", import_id: "1", original_filename: "", ...
Craig Nakamoto's user avatar
0 votes
1 answer
45 views

backbone looses context on fetch

I have a collection with a custom fetch function and a onFetchSuccess function. The onFetchSuccess function needs to trigger some other events, so it is calling this.trigger and here is where it gets ...
munHunger's user avatar
  • 2,869
-2 votes
2 answers
73 views

var not defined - backbone.js

I am quite new to backbone.js i am trying to access a var from file B to file A. currently i have declared file A as below window.dog = Backbone.Collection.extend({ model : animal, ...
Divakar R's user avatar
  • 835
-1 votes
1 answer
39 views

Will backbonejs model cid be unique across multiple collection?

I want to know that will backbone model cid will unique among multiple collection. Example: I have pageCollection and each pageCollection will contains another collection called controlCollection. ...
No one's user avatar
  • 1,140
-1 votes
1 answer
74 views

backbone js getByCid not working

The backbone getByCid is not working when i viewed in console.log it showing the error as TypeError: test.getByCid is not a function. By using at(0).cid it shows the output as 'c1' why its not working....
GGSankar's user avatar
0 votes
1 answer
33 views

backbone js: collection event function options index undefined

I tried to get index value for the model. but its returning undefined value. how to get index value once an event is triggered. var Test=new Backbone.Collection(); Test.add({name:'gowtham',age:20}); ...
GGSankar's user avatar
0 votes
1 answer
21 views

Can backbone model is having attribute backbone model simple array

Backbone model attributes can be string, objects, backbone collection etc. But is it possible that an attribute is an array of backbone model? Ex: var Model - Backbone model Model.get('charts') - ...
Mahaveer Agarwal's user avatar
1 vote
1 answer
28 views

Why is there multiple copies of the collection nested inside the models?

I'm creating a collection in backbone js, after this fetch data from the backend, I print in the console inspector in chrome, but something caught my attention in the attributes. The collection has ...
Cristino's user avatar
  • 311
1 vote
1 answer
400 views

How do you delete all models in an Alloy Collection

From within a controller function, how do you delete all the models in an Alloy Collection. The collection is using properties sync adapter. I think the backbone reset method is the way to go but I ...
Newport99's user avatar
  • 483
0 votes
1 answer
73 views

"Undefined is not a function" error when calling a Backbone collection's fetch function

I am getting an error when calling the fetch function. Undefined is not a function Error in Backbone js var models = Backbone.Model.extend({ userId: function() { return this.get('userId'...
Ajay Thakur's user avatar
  • 1,064

15 30 50 per page
1
2 3 4 5
35