9
I have a layout view with a region, in that region I have a item view that triggers an event but it doesn't seem to be bubbled up to the layout view. Am I doing something wrong or is this designed behavior? I assume the itemview prefix is not added as the parent view is not a collection view? Either way the event is never bubbled to the layout view.
layoutView = Marionette.Layout.extend({
template: "#layout-template",
regions: {
titleRegion: "#job-title-region"
},
triggers: {
"save:clicked" : "onSaveClicked"
},
onSaveClicked: function (args) {
alert('Clicked');
}
});
childview = Marionette.ItemView.extend({
template: "#child-template",
triggers: {
"click .js-save": "save:clicked"
}
});
UPDATE:
See this fiddle http://jsfiddle.net/7ATMz/11/ I managed to get the layout view to listen to the child event but I have to wire it up outside of the layout view itself and break encapsulation. Can I do this in the layout view in anyway?
Thanks,
Jon