-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic regions in LayoutView #2160
Comments
This is a call for a new view class, something that does not need to be in core, but can be easily pulled in. I don't think this complexity belongs in the root layout base class. |
I dont know why but I thought the regionManager was private in LayoutView but it's not. So yeah, a simple extend on LayoutView could do the job. |
@samccone A region that handles multiple views could achieve a similar goal. Since you wouldn't consider a LayoutView with dynamic regions for core, would you be more favorable toward a multi-region? |
I ask because, if core is more open to a multi-region than a dynamic layout, I'm sure @JSteunou and I could come up with something. |
Yeah The right way to explore this is going to be in a labs repo I think and we can play with the API outside of core... we can always talk about pulling it in after |
My need was not about multiple views in a single region, but I'm ok to drift on this subject. I can see mine is too specific and at the end I can reach it pretty easily. @jmeas link to this https://github.com/joezimjs/MultiRegion maybe it can be useful |
Create a Repo and we'll pull it into Labs! |
moving the work to here |
Nice |
So I have a use case, so do @ianmstew and other folks on gitter.
Considering a sub app or module handling modals, I can have multiple modals. All the modal are in a LayoutView instance, the same for every modals.
In my controller I have dirty things like this
My
this._layout
is just an instance of empty LayoutView. I should have put all the logic of dynamically adding node & regions inside, but eh... Thinking about it will chatting with Ian I was like: why this can be part of Marionette?So, is it possible to add a kind of
addDynamicRegion
that would take a regionName and some options for the node like nodeName, className, etc... returning the node.The text was updated successfully, but these errors were encountered: