Thursday 15 August 2013

backbone.js - Backbone View events don't get destroyed -


I'm having trouble with no point-of-view events, i mean a scene

  var myView = Backbone View. Extension ({events: {"click" .item ":" next page "," scroll ":" iscrolling "," click on click .zoom ":" imagez "}, start: function () {this.collection .on ("reset", render it,);}, execution: function () {...}}); Var Views = New MyView (); DestroyArray.push (see);   

Once I need to delete the view, I call through my router, a function that loop through the deleted array and destroy the arrows [i]. Close () (see below) before submitting the next scene. backbone.view.protitip.clo = function () {this.undellegateEvents (); The $ el.removeData () nickel () .. This.remove (); If (this.onClose) {this.onClose (); }}

Removes the view from the close functions page, but events (and dom elements) actually move forward and backward in the incremental scenes. Is there something that I am doing wrong?

When I walk between scenes, I'll restart them. I.e.

  var view = new myView (); DestroyArray.push (see); ... view.close (); ... var view1 = new myView1 (); DestroyArray.push (View1);   

I thought that my problem could arise, but the incidents that have been added are not equal to the number of incidents bound in the scene.

Any help is greatly appreciated. Thank you.

Please take a look at the methodology presented in backbone 0.9 to help deal with the removal.
You may have:

  start: function () {this.listenTo (this key, 'reset', this.render); } Backbone.view.protipip.close = function () {this.remove (); }   

In addition you do not have to specify the reference with this method.

Edit: Did it before.

No comments:

Post a Comment