grails-enhanced-scaffolding
grails-enhanced-scaffolding copied to clipboard
Enhanced scaffolding plugin for Grails 2+
Enhanced scaffolding plugin
This plugin adds a number of JavaScript enhancements to core Grails scaffolding. The enhancements can be loaded by adding
<r:require module="scaffolding"/>
to a page or layout. If the resources plugin is not being used then individual JavaScript and CSS files need to be included.
The current set of enhancements is:
grails.ajaxloader
Displays a "Loading" indicator when there are active AJAX requests pending.
grails.alerts
Enhances Grails' flash and error messages to display as dismissible message overlays at the top of the page.
grails.autocomplete
Uses the jQuery-UI autocomplete control to replace select elements used for many-to-many and one-to-many relationships. Note: jQuery-UI is an optional dependency of this plugin so this enhancement will not do anything if jQuery-UI is not found in the page.
grails.errors
Replaces field-specific error messages at the top of the form with tooltips next to the individual fields that are only displayed when the field is focused.
grails.forms
Minor form enhancements including ensuring the first field (or first field with an error) is focused.
grails.fouc
Attempts to avoid a "Flash of unstyled content" by only displaying the document body once it has finished loading.
grails.list
AJAX-enhances scaffolding list pages so that pagination and sorting are done via AJAX instead of reloading the entire page. Note: in order that bookmarking, deep-linking and history navigation (the back and forward buttons) continue to work this enhancement will only load on browsers that support the history API.
grails.range
Replaces select elements used to represent domain class properties that have a range constraint with native HTML range inputs in browsers that support them.
Included libraries
The enhanced scaffolding plugin depends on the following software:
- The [jQuery.tipsy][http://onehackoranother.com/projects/jquery/tipsy] plugin.
To-do
General
- Use pjax instead of grails.list.
- Get rid of the *.loader.js scripts as they are only necessary for qunit. Possibly use a config driven loader to allow apps to easily disable unwanted enhancements.
- Move autofocus enhancement to Grails core.
Improvements
- grails.range should use a jQuery-UI slider in browsers that do not support
input type="range"if jQuery-UI is available.
New enhancements
- In-place editing of related entities using a modal popup of the relevant create or edit form.