This plugin contains the jquery-ui 1.6rc5 javascript, css, and image files. It also contains a simple grails taglib which is documented below.
To use this plugin, the jquery plugin is also needed. I have not declared
a dependency, because the current version number of that plugin (1.0RC1)
can't be parsed, aborting the install of my plugin.
First build this plugin:
git clone git://github.com/bartschuller/grails-jquery-ui.git cd grails-jquery-ui grails package-plugin
Then install it into your grails project:
cd ~/myproject grails install-plugin jquery grails install-plugin ~/grails-jquery-ui/grails-jquery-ui-0.1.zip
To be used inside <head>, it loads the appropriate JavaScript and
CSS files. It is an empty element, which recognizes the following attributes:
comma separated list of ui components to include. Possible values: accordion, datepicker, dialog, draggable, droppable, progressbar, resizable, selectable, slider, sortable, tabs
comma separated list of effects to include. Possible values: blind, bounce, clip, drop, explode, fold, highlight, pulsate, scale, shake, slide, transfer
javascript packing to use. Can be min (default), packed or normal
css theme to use, defaults to base
To be used inside <jq:jquery>, it attaches a datepicker widget to
the elements selected by the selector. It currently knows the following
attributes:
The jquery selector
The date format to use, which defaults to m/d/y because that is the only format which grails can successfully convert from a String to a Date. note The jquery-ui date format differs from the Java SimpleDateFormat.
The datepicker shows how easy it is. You can either add more attributes to it and use it as a template for other widgets, or use raw jquery-ui JavaScript.
The file to edit is grails-app/taglib/JqueryUiTagLib.groovy
The following themes are included:
base
The default theme, white background with blackish widgets
Cupertino
As downloaded from the gallery at http://ui.jquery.com/themeroller
You can add new themes by using the themeroller, renaming the downloaded
directory and placing it in web-app/themes/ in this plugin (or in
the installed plugin directory inside your project)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="layout" content="main" />
<title>Grails jQuery UI test</title>
<g:javascript library="jquery"/>
<jqui:resources components="datepicker" mode="normal" theme="Cupertino"/>
<jq:jquery>
<jqui:datepicker selector="#myDate"/>
</jq:jquery>
</head>
<body>
<g:form>
<input id="myDate" name="myDate" type="text" />
</g:form>
</body>
</html>
The grails plugin was written by Bart Schuller <[email protected]> See AUTHORS.txt for the jQuery UI authors.