Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Backbone.js 如何解除默认视图事件绑定的绑定?_Backbone.js_Backbone Events_Marionette_Backbone Views - Fatal编程技术网

Backbone.js 如何解除默认视图事件绑定的绑定?

Backbone.js 如何解除默认视图事件绑定的绑定?,backbone.js,backbone-events,marionette,backbone-views,Backbone.js,Backbone Events,Marionette,Backbone Views,我有一个由主干木偶项目视图呈现的集合。每当重置集合时,都会重新呈现视图。据我所知,这是默认行为。有什么方法可以禁用它吗 var ActiveWordView = M.ItemView.extend({ template: '#active-word-template', tagName: 'form', onRender: function() { // This is being triggered when the collection resets

我有一个由主干木偶项目视图呈现的集合。每当重置集合时,都会重新呈现视图。据我所知,这是默认行为。有什么方法可以禁用它吗

  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);

重写
initialEvents
方法

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

  initialEvents: function() {},
});

重写
initialEvents
方法

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

  initialEvents: function() {},
});

我正要在我的答案上点击“post”时,这条消息传了过来。正是我要说的:)我刚打完问题,我想“我应该看看来源”。2分钟后,我找到了答案,一目了然。我正要在我的答案上点击“post”时,这条消息传了过来。正是我要说的:)我刚打完问题,我想“我应该看看来源”。2分钟后找到答案,一目了然。