0

バックボーンマリオネットアイテムビューによってレンダリングされるコレクションがあります。コレクションがリセットされるたびに、ビューが再レンダリングされます。私が解決できる限り、それはデフォルトのBackbone.Marionetteの動作です。無効にする方法はありますか?

  var ActiveWordView = M.ItemView.extend({
    template: '#active-word-template',
    tagName: 'form',

    onRender: function() {
      // This is being triggered when the collection resets, even
      // though I didn't specify that behaviour in an initializer.
      console.log("Active word re-rendered");
    }
  });



  var activeWordView = new ActiveWordView({
    collection: this.model.get('words'),
  });
  this.activeWordRegion.show(activeWordView);
4

1 に答える 1

4

メソッドをオーバーライドしinitialEventsます。

var ActiveWordView = M.ItemView.extend({
  template: '#active-word-template',
  tagName: 'form',

  initialEvents: function() {},
});
于 2012-07-24T15:13:32.923 に答える