Vic*_*Vic 13 javascript backbone.js marionette
我有一个牵线木偶布局,里面有一个视图区域.我怎样才能获得对该视图的引用?
例如:
var layoutView = Backbone.Marionette.Layout.extend({
regions: {
myRegion: '.some-element'
},
initialize: function(){
this.render();
this.myView.show(new someView());
},
test: function(){
var view = this.myRegion.get() // or something to retrieve the view?
}
});
Run Code Online (Sandbox Code Playgroud)
我的意思是,我可以将视图实例保存到"this"中,但是木偶肯定有办法检索它......对吗?
dbr*_*rin 19
它应该只是this.myRegion.currentView
和模型绑定查看: myRegion.currentView.model
| 归档时间: |
|
| 查看次数: |
9377 次 |
| 最近记录: |