How does one go about displaying a controller action inside of jquery modal dialog?
相关问题
- Setting 'option' on jqueryui DatePicker cl
- Why does recursive submodule update from github fa
- How to pass options/params to formCollection field
- jquery-ui progressbar not showing
- JQuery - ToggleClass/AddClass/RemoveClass
相关文章
- jQuery UI Sortable: Scroll entire page as well as
- Set the z-index value of a jQuery autocomplete inp
- jQuery UI Sortable animations
- jQuery accordion: prevent pane from opening/cancel
- jQuery UI datepicker - Trying to capture click eve
- Disabling ctrl-click on jquery ui selectable
- Slide content / page transition
- How to style an unordered list with jQuery UI so t
Firstly you'll need your Javascript to load a url via ajax, this will depend on which kind of modal you are using etc, there's a ton of libraries out there. I will assume you are using the basic JQuery UI dialog Modal.
Example Link
Example Javascript (quick example found on google, many examples out there..)
Now you need to make sure your action doesn't render the main layout when providing the content for the modal via the ajax request.
Here's a really simple method of doing that by replacing the base layout with an empty view for ajax requests. This isn't the best method but it's the simplest for this case ;)
Example Action
application/layout/ajax-layout.phtml
I think you want this kind of code http://jqueryui.com/dialog/#modal-message inside the just display your action
Otherwise it's about to open an url into your modal it's like that http://blog.nemikor.com/2009/04/18/loading-a-page-into-a-dialog/