This is another way to do what you want.
What I did was so modal:
<div class="modal hide fade" tabindex="-1" id="editView"> {{view MainApp.ModalContainerView elementId="modalContainerView"}} </div>
Where "MainApp.ModalContainerView" is a container. Then, when I wanted to display / show any template for the model, I did this:
var containerView = Em.View.views['modalContainerView']; if(containerView == undefined) return; var temp = containerView.toArray(); if(temp.length > 0) containerView.removeAllChildren(); containerView.addObject(view);
Where to "view" his presentation, which you want to show in modal mode. Please note that I am deleting the last view that is in the “modalContainerView” to be sure that I have no view in this container.
Finally, I need to show only the modality:
$('#editView').modal({ show : true, keyboard : true, resizeToFit : true });
I hope this can help you.
Juanitos
Juan jardim
source share