问题标签 [backbone.eventbinder]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
286 浏览

events - 如何在视图中使用 Backbone.EventBinder

参考 Backbone.EventBinder 上的这篇文章,我不知道如何将 EventBinder 与 Backbone 视图一起使用(这是最流行的用例)。是否仍然建议按照本文中的建议向 Backbone.View 原型添加 close() 方法和向视图添加 onClose()方法?还有一个人在哪里存储活页夹对象,以便可以在关闭时调用 binder.unbindAll()?关闭子视图的推荐方法是什么(例如,集合上的父视图在关联模型上具有子视图)。一个工作示例将是对 Backbone.EventBinder 项目的一个很好的补充。

0 投票
1 回答
56 浏览

javascript - Incorrect this in backbone binding

Here my code of Backbone.View. I have problem with binding method to DOM element, console.log show this like a DOM element which i clicked. I use undescore method _.bind to correct binding this, what a problem?