一般来说,如何从 Backbone 中的 subview 访问父 View ?
具体来说,在 Backgrid.js 中,有没有办法从单元格访问父行?
最佳答案
通this
作为初始化步骤中 subview 的一个选项:
var ChildView = Backbone.View.extend({
initialize : function (options) {
this.parent = options.parent;
}
});
// somewhere in the parent view ...
new ChildView({parent:this});
关于Backbone.js:从 subview 访问父 View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19398530/