Plugins You can find out about all the publicly available Grails plugins.

Dojo for Grails

11 votes
compile "org.grails.plugins:dojo:"

 Documentation  Source  Issues


The Dojo Plugin adds the Dojo toolkit to your application. This javascript library provides a complete collection of user interface controls, giving you the power to create web applications that are highly optimized for usability, performance, internationalization, accessibility, but above all deliver an incredible user experience. This plugin provides full support for <g:formRemote>, <g:remoteField>, <g:remoteFunction>, <g:remoteLink> and <g:submitToRemote>. Also adds these two tags: <dojo:paginate> and <dojo:sortableColumn>. These do the same thing that the grails versions of the tags but will do them via ajax calls. Adds these convenient widget tags: <dojo:header>, <dojo:require>, <dojo:css>, <dojo:grid> (<dojo:col>, <dojo:bind>), <dojo:dataSourceView> (<dojo:nodeTemplate>, <dojo:nodeDefaultTemplate>), <dojo:popOver> (<dojo:popOverContent>, <dojo:closePopOver>), <dojo:frame> (<dojo:frameLink> <dojo:onload>), <dojo:tree> (<dojo:treeNode>, <dojo:treeLeaf>), <dojo:help>, <dojo:toolip>, <dojo:editor>, <dojo:datePicker>, <dojo:timePicker>, <dojo:dateTimePicker>, <dojo:numberPicker> For more information about the Dojo Toolkit please visit


To install the 1.7.1 version of Dojo (add to BuildConfig.groovy):
compile ":dojo:"

To install the 1.6.1 version of Dojo (add to BuildConfig.groovy):

compile ":dojo:"


grails install-custom-dojo

  • This target will build an optimized version of dojo that is tailored to your application. Read the FAQ for more information.



To install the Dojo plugin type this command from your project's root folder:

grails install-plugin dojo

The base dojo file will automatically be included in your application under web-apps/js/dojo/1.7.2/dojo/dojo.js. This will give a dojo implementation for <g:formRemote>, <g:remoteField>, <g:remoteFunction>, <g:remoteLink> and <g:submitToRemote>. If you wish to use more of the dojo toolkit in your project, you can include it into your application by using the <dojo> tags.

Getting Started

To use dojo with the built in grails tags add the line to your Config.groovy file:

Next add the basic dojo header:

<dojo:header theme="soria" showSpinner="true"/>

Then add the theme definition to your body tag:

<body class="soria">

Include some dojo modules that you would like to use with the <dojo:header> tag or the <dojo:require> tag:

<dojo:header theme="soria" modules="['dijit.layout.TabContainer','dijit.layout.ContentPane', 'dijit.Editor']"/>


<dojo:header theme="soria"/> <dojo:require modules="['dijit.layout.TabContainer','dijit.layout.ContentPane', 'dijit.Editor']"/>

Remote Pagination and Sorting

The dojo plugin also comes with <dojo:sortableColumn> and <dojo:paginate> tags. These tags support all the properties that the built-in grails tags supports and mixes in all the properties of the <g:remoteLink> tag.
<dojo:sortableColumn action="getList" property="color" title="Color" update="myUpdateRegion"/>

<dojo:paginate total="${total}" update="myUpdateRegion" next="Next Page" prev="Prev Page" action="listFragment"/>

Data Grid Tag

  <title>Simple Grid Example</title>
  <dojo:header theme="tundra"/>
  <style type="text/css">
    .dojoxGridCell {font-size: 12px;}
    h2 {margin-top: 0;}
<body class="tundra">
<% header = {
  return """
    <button style="float:left">Selected: ${dojo.bind(variable: 'myGrid.selected')}</button>
    <h2>My Widgets ( ${dojo.bind(variable: 'myGrid.rowCount')} )</h2>
} %>
<dojo:grid name="myGrid" controller="widget" action="listJson" max="20" sort="name"
           style="height:200px; width:600px" header="${header}" selectable="true">
  <dojo:col width="50%" label="Name" field="name">{} ({})</dojo:col>
  <dojo:col width="15%" label="Color" field="color"/>
  <dojo:col width="15%" label="Shape" field="shape"/>

The data grid only reads JSON data. So in WidgetController:

class WidgetController {

def listJson = { def widgets,widgetsTotal widgetsTotal = Widget.list().size(); widgets = Widget.list(params) render(contentType: "text/json") { identifier = "id" numRows = widgetsTotal items = array{ widgets.each {w -> item("id","name","color":w.color,"shape":w.shape) } } } } }


PopOver Tag

<dojo:popOver label="Click to Activate PopOver" type="button">
    <div style="padding:2em">
        This is a popover that was activated by a click from a button.

/* *** OR *** */

<dojo:popOver label="Load the action" type="button" controller="widget" action="popOverForm" containLinks="true"/>


dojo:css   [file]
        <dojo:css file="dojo/resources/dnd.css" />

More Information


Dojo 1.7 History (March 31, 2012) (February 7, 2012)

  • Switched from shrinksafe to google closure compiler for optimized dojo builds.
  • Fixed bugs in the <dojo:editor>
  • Addressed issue GPDOJO-12. This allows async=true for AMD modules. (January 30, 2012)

  • Fixed a bug in the <dojo:editor> (January 15th, 2012)

  • Bug fix for <dojo:tree> rendering issue with static data.
  • Added support for defining custom modules in <dojo:header> (January 12th, 2012)

  • Bug fix of the static data in <dojo:tree>
  • Added <dojo:help> and <dojo:tooltip> (January 10th, 2012)

  • Bug fix for the <dojo:editor>
  • Bug fix for <dojo:menu>
  • Added ability to specify static content in the <dojo:tree>
  • Added <dojo:panel>

1.7.0 (January 9th, 2012)

  • Upgraded to Dojo 1.7.1
  • Added <dojo:datePicker>, <dojo:timerPicker>, <dojo:dateTimePicker>, <dojo:numberPicker>
  • Added <dojo:editor>
  • Support new dojo optimization builder.

Dojo 1.6 History (February 18, 2014)

  • Per pull request by Jeremy McKay, added onchange handlers to <dojo:datePicker>, <dojo:timerPicker>, <dojo:dateTimePicker>.
  • Refactored plugin code with fixes from Burt Beckwith (April 29, 2013)

  • Fixed a bug when using the custom build feature with grails 2.2.x versions. (January 23, 2013)

  • Fixed bug in show more capability and any other remoting tag that used the position attribute.
  • Improved grails spinner display for IE 6 and 7. (December 12, 2012)

  • Fixed another bug. Restored old functionality when a dev doesn't specify the new position attribute. (December 11, 2012)

  • Fixed bug introduced in where the failure DOM element was being overwritten by the success DOM. (December 10, 2012)

  • Fixed spinner to always show in the middle of the viewport
  • Added new <dojo:showMore> tag.
  • Added new "position" property for all remote tags. This allows a developer to specify where the content should get loaded. Options are "before, after, first, last, only". (Follows code) (November 9, 2012)

  • Added support for ajax file-uploads in <g:formRemote> and <g:submitToRemote> tags.
  • Fixed issue #38 with g.remoteFunction and formName property. (June 4, 2012)

  • Fixed bug with dojo:frame and submitting multi-part forms.
  • Fixed dijit registry issues when loading new url in dojo:frame when there are open tooltips and drop downs. (April 24, 2012)

  • Fixed loading message with the <dojo:dialog> and the base dojoui.widget.Dialog.js. (March 23, 2012)

  • Fixed a minor but with <dojo:dialog> and using form submissions with containLinks="true". (March 14, 2012)

  • Fixed a bug in the <dojo:editor> that caused IE 6,7, and 8 to break when using multiple editors. (February 17, 2012)

  • Updated <dojo:dialog> and <dojo:editor> to add support for iOS devices. (February 16, 2012)

  • Various bug fixes and improvements in <dojo:tree>, <dojo:dialog>, <dojo:popOver>, and <dojo:editor> (February 1, 2012)

  • Fixed a bug in the optimized dojo build process. (January 30, 2012)

  • Back-ported all changes in the 1.7.x version of the plugin to the 1.6 version.
  • This includes <dojo:menu>, <dojo:editor>, <dojo:help>, and <dojo:tooltip>. (December 5, 2011)

  • Supports Grails 2.0.0.RC3
  • Added <dojo:tree> (<dojo:treeNode>, <dojo:treeLeaf>)
  • Changed <dojo:dataSourceView> to use name property instead of id.
  • Removed old unused code like dojoui.js
  • (GPDOJO-9) Changed from djConfig to dojoConfig.
  • Addded the showSpinner attribute to <dojo:header>
  • Addresses github issues #23, #10 (October 30, 2011)

  • Add support for Grails 2.0.0.RC1
  • Fixed 10 minor bugs.
  • Changed id to name for most tags that support action and controller. This follows grails conventions.
  • Added new attributes to the <dojo:dialog>
  • Added <dojo:onload> for <dojo:frames> (September 6, 2011)

  • Add support for Grails 2.0 (August 27, 2011)

  • Upgraded to Dojo 1.6.1
  • Works in Firefox 3+ (including 4) IE 6-9

Dojo 1.4 Plugin History (March 9, 2011)

  • Fixed bug in <dojo:frame>
  • Fixed bug in <dojo:dataSourceView> (February 22, 2011)

  • Added <dojo:frame> (<dojo:frameLink>)
  • Added <dojo:dialog> (<dojo:closeDialogButton>, <dojo:openDialog>)
  • Added <dojo:menu> (<dojo:menuSeparator>, <dojo:menuItem>)
  • Added <dojo:tabContainer> (<dojo:contentPane>)
  • Minor bug fixes in <dojo:popOver> and <dojo:popOverContent> (February 11, 2011)

  • Added controller/action/params properties to the <dojo:popOver> tag. Allows remote content to be loaded.
  • Added containLinks to <dojo:popOver>. This keeps form submissions and links in the popOver. (January 31, 2011)

  • Added <dojo:grid>, <dojo:col> and <dojo:bind> tags for interacting with Dojo Grids easily.
  • Added <dojo:dataSourceView>, <dojo:nodeTemplate>, and <dojo:nodeDefaultTemplate> for dataSource Templates
  • Added <dojo:css> for easily adding css files from the dojox namespace. (December 13, 2010)

  • Changed the location of the dojo build definition from the dojo.profile.js to the Config.groovy file. (December 7, 2010)

  • The full dojo toolkit is now included in the plugin.
  • Added new tags to bring dojo into the application: <dojo:header>, <dojo:require>
  • Added dojo packaging system to make an optimized dojo release during war creation.
  • Removed "install-dojo" script.
  • Added the optional "install-custom-dojo" to create an optimized dojo release outside of war creation. (October 9, 2010)

  • Minor Bug fixes (October 5, 2010)

  • Added support for simple strings in url param.
  • Added dojo taglib with ajax remote paginate and sortableColumn

1.4.3 (October 1, 2010)

For bugs and requests: