0

バックボーン ビューがあります。クリックイベントで、モデルのデフォルト属性を変更できるようにしたいです。

4

1 に答える 1

0

内部ビュー初期化使用.on関数(ここでは doc)。例えば:

  initialize: function(options) {
    model.off();  // if you forget to write the line, it works  how many time you rendered this view
    model.on( 'all', this._handleChanges, this); // all or another event  name
  }

編集

ここで使用.off()したので、すべて内部に書きonました。私は offバインドするイベントを行いonます。詳細については

于 2013-09-04T11:27:20.110 に答える