(Quick Reference)

6.7.3 用Dojo实现Ajax - Reference Documentation

Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith

Version: null

6.7.3 用Dojo实现Ajax

Grails features an external plugin to add Dojo support to Grails. To install the plugin type the following command from the root of your project in a terminal window:

grails install-plugin dojo

This will download the current supported version of Dojo and install it into your Grails project. With that done you can add the following reference to the top of your page:

<g:javascript library="dojo" />

Now all of Grails tags such as remoteLink, formRemote and submitToRemote work with Dojo remoting.

Grails通过一个外部插件来提供对 Dojo 的支持。要安装此插件,在字符终端的窗口中,进入你工程的根目录,输入下面命令即可:

grails install-plugin dojo

插件将为你下载当前支持的Dojo版本,并且安装到你的Grails工程中。此后你就可以在你页面的开头添加如下的引用即可:

<g:javascript library="dojo" />

现在所有Grails的Ajax标签比如remoteLinkformRemotesubmitToRemote都使用Dojo来工作了。