Marionette: get single instance of a layout view

300 views Asked by At

I am creating an application which has multiple views. Each view has got a left sidebar region and a main content region.

I have added two regions in my layout -> leftSidebarRegion and mainContentRegion. Now for each of these views the left sidebar content remains the same, but the mainContentRegion keeps on changing. This change in mainContentRegion is event driven.

I want to know how can I access my layout instance [created once in main controller of my module] so that leftSidebarRegion is not reloaded and I only change mainContentRegion.

Additional information: I have different view files for populating leftSidebarRegion and mainContentRegion.

1

There are 1 answers

3
The Pax Bisonica On

You can access the region from the layout object.

var layout = new Layout();

layout.mainContentRegion.show(new ViewYouWantToRender());