This is for backbone.js questions that specifically relate to Backbone's event handling system.
Questions tagged [backbone-events]
787 questions
0
votes
1 answer
How do I unbind the default view event bindings?
I have a collection which is rendered by a Backbone Marionette item view. The view is being re-rendered whenever the collection is reset. As far as I can work out, that is default Backbone.Marionette behaviour. Is there a way I can disable it?
var…

David Tuite
- 22,258
- 25
- 106
- 176
0
votes
1 answer
Listen to Child Events in Backbone.View
I'd like to listen to an event on a child in my Backbone.View. I thought this would be the correct way to do it but I'm not sure. The update function in the parent is not being called. Thanks for the help.
text.js.coffee
class App.Views.Text…

botbot
- 7,299
- 14
- 58
- 96
0
votes
1 answer
Re-render backbone view when fetching collection with add:true parameter
I have backbone collection and under some circumstances I am fetching more models into the collection with:
collection.fetch({data: {...}, add: true});
I need view of the collection to be re-rendered when new members arrive.
"reset" event is not…

Boffin
- 570
- 2
- 7
- 21
0
votes
3 answers
BackboneJS catch event OnAdd from initial load
I'm creating a collection without using fectch(), but with JSON data already available.
this.displays = new Displays(jQuery.parseJSON($('#temp_json').html()));
I need for each model of that collections to have a 'position' value setup, which should…

LEM01
- 871
- 3
- 15
- 23
0
votes
2 answers
Javascript event object: Where is the selector
I have following setup in my Backbone View:
var SomeView;
SomeView = Backbone.View.extend({
initialize: function() { this.render(); },
render: function() { // render form },
events: {
"keydown form.registration input":…

dev.pus
- 7,919
- 13
- 37
- 51
0
votes
2 answers
How to clean views and models in Backbonejs
movieDb.Router = Backbone.Router.extend({
routes:{
'': 'landPage',
'home': 'landPage',
'login': 'login',
'signup': 'signup'
},
landPage: function(p){
…

Barry
- 1,587
- 2
- 13
- 19
0
votes
1 answer
Unable to reference Backbone model after model.set in Backbone View
I'm trying to get the view to self render by binding a change event to the views model. I've created a custom function on PageView which takes a model from the Pages collection as a paramater and uses this.model.set(data) to trigger the model change…

James Parker
- 2,095
- 3
- 27
- 48
0
votes
1 answer
The best way to trigger an event when the model.fetch is complete
I am looking for the best way to trigger an event when the fetch is completed.
This code works but I am curious to know if there is a better way to accomplish the following task.
var myApp = new…

Lorraine Bernard
- 13,000
- 23
- 82
- 134
0
votes
2 answers
Can't call jQuery-UI function in Backbone.js view
I have a web app and I use Backbone.js.
In the Login view I use jQuery UI button.
In the template code I call $(".btn").button(); with no problem.
But when I want to act after the user clicks the button and call:
$('#btnSubmit').button({
disabled…

Roy Tsabari
- 2,000
- 6
- 26
- 41
0
votes
2 answers
Sorting a Backbone Collection in an Add event handler re-fires the Add event
I have a collection which sorts itself based on a model's attribute, sometimes I want to add a model and just calculate the order within the add event handler. The problem is that when I call collection.sort() within the add event handler, for some…

Clarence Liu
- 3,874
- 2
- 25
- 29
0
votes
1 answer
el is undefined when event fires
I trigger an event from one view like this:
select: function () {
// Shorthand for the application namespace
var app = brickpile.app;
// Trigger the selected event
app.trigger('selected', this.model);
}
and binds to the same event…

marcus
- 9,616
- 9
- 58
- 108
0
votes
1 answer
After backbone model is removed from collection, destroyed, and remove from DOM, anymore zombie left to be handled?
From what I have read http://lostechies.com/derickbailey/2011/09/15/zombies-run-managing-page-transitions-in-backbone-apps/ and Backbone.js : repopulate or recreate the view? I learned that hidden view should be unbind'ed from events.
How about…

Henry
- 32,689
- 19
- 120
- 221
0
votes
1 answer
backbonejs's set method could not work
I have already define a model use backbone:
window.ResourceModel = Backbone.Model.extend({
default:{
'relativeurl':'unknow',
'type': "unkonw"
},
initialize: function(){
…

hh54188
- 14,887
- 32
- 113
- 184
0
votes
1 answer
Backbone view event atacched to all views
I'm doing my first application in backbone and i get a strange thing happening trying to attach an event.
I got this code so far:
//View for @girl, EDIT action
GirlEditView = Backbone.View.extend({
initialize: function(el, attr) {
…

nax
- 1,184
- 1
- 8
- 19
0
votes
2 answers
Render function not called when fetching collection
I have defined a view bind to a collection.
1) when I initialise the View, a fetch call on collection is performed.
2) If I look to the result of the get request it is ok
3) The I would like to trigger this change (in myCollection) for calling the…

underscore666
- 1,719
- 4
- 24
- 37