在Grails中应用Extjs
来源:互联网 发布:手机有网络微信不能用 编辑:程序博客网 时间:2024/05/17 23:39
This plugin is discontinued byit's author due to the ExtJS license fiasco emergedrecently.
This plugin provides integration with the ExtJavaScript Library. When installing the plugin, it downloads andinstalls automatically the latest Ext 2.0.2 distribution in yourapplication, and registers itself to be used with the adapativeAJAX tags. It also contains two helper tags to easily includeadditional Ext javascript and css files as well.
Installation
To install the Ext plugin type this commandfrom your project's root folder:
grails install-plugin ext
The complete Ext distribution is downloadedand installed under your project's \web-app\js\ext\2.0.2folder.
Usage
To use Grails' adaptive AJAX support just addthe folowing line in the head section:
<g:javascript library="ext" />
If you want to include additional Extjavascript and css files include them using:
<ext:javascript dir="build/widgets" file="MessageBox-min.js" /><ext:javascript dir="build/widgets" file="MessageBox-min.js" version="2.0.1" /> // version to be used in case multiple version installed<ext:stylesheet dir="resources/css" file="ext-all.css" />
Overriding default javascript files
By default ext-base.js and ext-core.js areincluded when using <g:javascript library="ext"/>. Adding additional libraries to the default listcan be done in a BootStrap class:
import org.codehaus.groovy.grails.plugins.web.taglib.JavascriptTagLib
class BootStrap { def init = { servletContext -> JavascriptTagLib.LIBRARY_MAPPINGS.ext += ["ext/2.0.2/build/widgets/MessageBox-min", ..] } def destroy = { }}
It's also possible to replace all defaultincluded javascript libraries. For example if you want to useext-all.js instead of ext-core.js. Just incorporate the followinginto your BootStrap.
import grails.util.GrailsUtilimport org.codehaus.groovy.grails.plugins.web.taglib.JavascriptTagLib
class BootStrap { def init = { servletContext -> JavascriptTagLib.LIBRARY_MAPPINGS.ext = ["ext/2.0.2/adapter/ext/ext-base", "ext/2.0.2/ext-all"] } def destroy = { }}
If you want to include debug versions of theincluded javascript files in your development environment, dosomething like:
import grails.util.GrailsUtilimport org.codehaus.groovy.grails.plugins.web.taglib.JavascriptTagLib
class BootStrap { def init = { servletContext -> if (GrailsUtil.isDevelopmentEnv()) { JavascriptTagLib.LIBRARY_MAPPINGS.ext = ["ext/2.0.2/adapter/ext/ext-base", "ext/$2.0.2/ext-core-debug"] } } def destroy = { }}
Upgrading
If you want to upgrade:
- Delete the plugin from the project's plugins folder
- (Optional) Delete the previous Ext version folder fromweb-appjsext
- Re-install the plugin by executing grails install-pluginext
Plugin version history
Discontinued (May 27, 2008)
2.0.2 (April 1, 2008)
- First release of the plugin
- 在Grails中应用Extjs
- Grails-DWR-Extjs
- Grails+DWR+Extjs
- Extjs中TabPanel应用
- ExtJS的TabPanel在Java应用中使用总结
- 在Eclipse中配置Grails工程
- 在Eclipse中开发Grails项目
- 如何在Eclipse中开发Grails项目
- 在Grails中添加时间控件标签
- 如何在grails中导出Excel列表
- Grails 在HttpSessionListener中使用service
- 在Grails中如何使用Class.forName
- ExtJS初探:在项目中使用ExtJS
- ExtJS初探:在项目中使用ExtJS
- ExtJS初探:在项目中使用ExtJS
- ExtJS初探:在项目中使用ExtJS
- EXTJS 中Ajax 应用示例
- EXTJS 中Ajax 应用示例
- ExtJS2.0快速入门(一)
- Django(迪亚戈)--Python Web 框…
- Grails--java下的快速开发框架
- 分析中国当今社会,草根的出路在哪里? --> 需要我们自己去拼搏去奋斗!
- 从Groovy与Java的异同点中,学习Gr…
- 在Grails中应用Extjs
- TurboGears---Python的开发框架
- 8月18日MyEclipse 7.0 发布
- Grails+DWR+Extjs
- 敏捷持续集成工具CruiseControl
- 2008 Google 开发者日活动--大会主…
- Apache 无法启动原因
- Bat 文件语法全攻略
- Bat 选择语法编写