|
|
|
JQueryUIDialogOn this page:
SummaryHomepage: http://docs.jquery.com/UI/DialogAuthor(s): see http://jqueryui.com/about Version: 1.8.16 A dialog is a floating window that contains a title bar and a content area. The dialog window can be moved, resized and closed with the 'x' icon by default. If the content length exceeds the maximum height, a scrollbar will automatically appear. A bottom button bar and semi-transparent modal overlay layer are common options that can be added. A call to $(foo).dialog() will initialize a dialog instance and will auto-open the dialog by default. If you want to reuse a dialog, the easiest way is to disable the "auto-open" option with:
$(foo).dialog({ autoOpen: false }) and open it with $(foo).dialog('open'). To close it, use $(foo).dialog('close').
UsageTo load the library into the current wiki page, add this somewhere on the page:
%JQREQUIRE{"ui::dialog"}%
This will initialized the following css classes to build the dialog widgets:
<div class="jqUIDialog" id="mydialog" title="Here's the title of the dialog" >
Here goes the content.
...
<a class="jqUIDialogButton jqUIDialogClose {icon:'ui-icon-circle-check'}">%MAKETEXT{"Ok"}%</a>
<a class="jqUIDialogButton jqUIDialogClose {icon:'ui-icon-cancel'}">%MAKETEXT{"Cancel"}%</a>
</div>
... which is activated by something like this:
<a href="#mydialog" class="jqDialogLink">Open Dialog</a>A dialog can also be opened using JavaScript:
jQuery("#mydialog").dialog("open");
To load a dialog asynchronously use a fully quallified hyperref as in
<a href="http://...." class="jqDialogLink">Open Dialog</a>This will fetch the content of the dialog from the given url and add it to the page before opening it. Once the dialog has been loaded it will be cached as part of the current page unless the cache option
to the jqDialogLink has been disabled:
<a href="http://...." class="jqDialogLink {cache:false}">Open Dialog</a>
In this case the dialog will alwas be fetched again from the backend using the given url.
Button Click ActionsWhen the button is clicked:
ExamplesDialog defined inlineOpen Dialog
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore
et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat.
Ok
Cancel
Dialog fetched asynchronouslyOpen Dialog Open Dialog (no cache)
%STARTSECTION{"dialog"}%
<div title="From Ajax call" class="jqUIDialog { modal:true, resizable:true, draggable:true, height:300, width:600}">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore
et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat.
<a class="jqUIDialogButton jqUIDialogClose {icon:'ui-icon-circle-check'}">%MAKETEXT{"Ok"}%</a>
<a class="jqUIDialogButton jqUIDialogClose {icon:'ui-icon-cancel'}">%MAKETEXT{"Cancel"}%</a>
</div>
%ENDSECTION{"dialog"}%
See http://jqueryui.com/demos/dialog/ for more demos.
r1 - 31 Oct 2011 - 18:06:02 - ProjectContributor
Copyright © by the contributing authors. All material on this site is the property of the contributing authors. Ideas, requests, problems regarding Wiki? Send feedback |