derickbailey/backbone.marionette — Issue #31: Nested regions/views
Author: simax
Created: 2012-02-23 14:10:28+00:00
State: open

Derick,

This is a question rather than an issue and I'd like your guidance please. I'm building an app that will have a navigation region which is essentially a main menu that will remain visible throughout the lifetime of the app. It will also have another "main" region that will contain a view dependant on the route selected. So far its just the same as BBCloneMail.

However some of the views that will be rendered in the "main" region are a little more complex and are logically made up of separate areas/views. One I can think of immediately is a view to manage "users" which might be a layout made up of a specific "users" menu and a list of users.

My first thought was to break the users view into a users layout region that contains the place holders for the 2 user views. Then call the show() method on the original main region to swap in the users layout region and in the onRender() of the users layout region instantiate the 2 user views and show them via the show() methods of the 2 user regions. Essentially nesting a region inside another view/region.

Is this the correct approach? what would you advise?

TIA,
SImon