问题描述
阅读这里的文档:http://grails.org/plugin/jquery-ui它说使用自定义主题我应该把主题放在:
webapp / jquery-ui / themes / {theme-name} /jquery-ui-1.8.10.custom.css
在我的main.gsp中应用标签时:
< jqui:resources theme =le-青蛙/>
Launch和Tomcat找不到该文件。标签似乎指向:
/myapp/plugins/jquery-ui-1.8.10/jquery-ui/themes/ le-frog / jquery-ui-1.8.10.custom.css
除非有一些魔法发生(我认为有)我可以理解为什么这显然不起作用。如果我将浏览器直接指向文件,即把它放在地址栏中:
http:// localhost:8080 / myapp / jquery-ui / themes / le-frog / jquery-ui-1.8.10.custom.css
问题出在插件源中的这一行
JqueryUiTagLib.groovy line 113
url = g.resource(插件:attrs.remove('plugin' ),dir:attrs.remove('dir'),file:attrs.remove('file'))
如果您删除插件属性,则链接将正确呈现。我认为插件应该做的就是如果主题属性jqui:resource存在,它应该将该插件属性关闭(参见第113行)。如果主题属性不存在,请加载插件附带的默认ui-lightness主题,这需要插件属性。
希望这是有道理的。或许应该向插件创建者提交补丁或者让他们知道。
reading the docs here:http://grails.org/plugin/jquery-ui
it says to use a custom theme I should put the theme at:
webapp/jquery-ui/themes/{theme-name}/jquery-ui-1.8.10.custom.css
When I apply the tag in my main.gsp:
<jqui:resources theme="le-frog" />
Launch and Tomcat can't find the file. The tag seems to point to:
/myapp/plugins/jquery-ui-1.8.10/jquery-ui/themes/le-frog/jquery-ui-1.8.10.custom.css
Unless there's some magic going on (and I think there is) I can understand why this clearly doesn't work. If I point the browser directly to the file, i.e. put this in the address bar:
http://localhost:8080/myapp/jquery-ui/themes/le-frog/jquery-ui-1.8.10.custom.css
Then it finds the file. What am I doing wrong?
The problem is with this line in the plugin source
JqueryUiTagLib.groovy line 113
url = g.resource(plugin:attrs.remove('plugin'), dir:attrs.remove('dir'), file:attrs.remove('file'))
If you remove the plugin attribute, the link is rendered correctly. I think what the plugins should do is if the theme attribute to jqui:resource is present, it should leave that plugin attribute off the url generation (see line 113). If the theme attribute is absent, load the default ui-lightness theme which comes with the plugin, which would require the plugin attribute.
Hope that makes sense. Should probably submit a patch to the plugin creator or just let them know.
这篇关于grails + jquery ui插件,使用自定义主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!