I want to retrieve a model of particular id number into my view. Here are how my controller looks like (API is working fine):
Controller
var EventController = Marionette.Controller.extend({
initialize: function(options){
this.model = options.model;
this.mainRegion = options.mainRegion;
},
edit: function(id) {
var _me = this;
//this is my model
var event = new Event({
id: id
});
event.fetch({
success: function(){
//this is my layout
_me.eventLayout = new EventView({
model: event
});
_me.mainRegion.show(_me.eventLayout);
}
});
}
});
The scenario is like:
- My controller functions are getting called using a router.
- My main Layout i.e. eventLayout contain some regions which are eventViews all in Marionette.
- The model.fetch is successful and I can see the details fetched from the API.
- All the subviews of the mail Layout are getting rendered perfectly.
- None of the data meant for main Layout template is getting rendered . Its just the DOM that gets rendered but not the data.