So, I have one view(marionette itemview) which is to render the google maps based on the address given as input.This view is being used in three places of the application.Where as in two places,
Case 1: I'm using regions to show the view(like: xyzregion.show(new mapView().render());),
Case 2: I'm not using region, instead I'm doing like: this.el.innerHTML = new mapView().render();.
Though marionette documentation has mentioned that ItemView, CompositeView, collectionView, LayoutView( Docs) does supports this functionality of onShowwhen,If I don't use the region to show the map view, onShow is not being triggered. After some research I came to know that "view itself won't trigger the onShow, instead it triggered by region.
Is there any way to trigger an "onShow", even though view is not bieng shown by region? or else is there any other method which does exactly same as "onShow"?
onRenderoronAttach? - ivarniThe attach event is only fired when the view becomes a child of the documentin marionette documemt. - SwathionRenderis called after the view's HTML is being generated whileonAttachgets called after it's acutally been placed into the document so that's most likely the closest one toonShow- ivarnionAttachalso, but same problem as withonShow, it is being triggered only when view is being shown by the region, for Case 2 it is not triggeringonAttach@ivarni. - Swathi