Marionette와 처음으로 놀고 있습니다. ItemView를 다시 렌더링 한 후에 이벤트가 트리거되지 않습니다. 간단한 예 :Marionette ItemView 다시 렌더링 한 후의 이벤트
App = new Marionette.Application;
App.addRegions({
headerRegion: '#header',
contentRegion: '#content',
});
App.addInitializer(function() {
this.Views = {
MainMenu : new MainMenuView(),
ContentOne : new ContentOneView(),
ContentTwo : new ContentTwoView(),
};
});
App.addInitializer(function() {
var self = this;
var eva = self.vent;
eva.listenTo(self.Views.MainMenu, 'content1', function() {
self.contentRegion.show(self.Views.ContentOne);
});
eva.listenTo(self.Views.MainMenu, 'content2', function() {
self.contentRegion.show(self.Views.ContentTwo);
});
});
App.on('start', function() {
var self = this;
self.contentRegion.show(self.View.ContentOne);
});
App.start();
ContentOneView & ContentTwoView를 다시 렌더링 한 후, 그 이벤트는 트리거되지 않습니다. 내가 뭘 잘못하고있어?
나는 self.contentRegion.show (self.View.ContentOne) 대신'self.View.ContentOne.render()'를 사용하려고했습니다. ',하지만 아무 것도 행복하지 않아. – iBoozyVoozy
예 : 각 ContentView에는 자체적으로 버튼이 있으며이 버튼에 대한 이벤트가 있습니다. 처음에는 모든 이벤트가 정상적으로 트리거되었지만 두 번째로 다시 렌더링 한 후에는 버튼에 대한 이벤트가 트리거되지 않았습니다. – iBoozyVoozy