我正在使用Grails 1.3.7,我想同時使用資源插件以及jQuery UI,當我想切換到不同的jQuery UI UI主題時,問題就出現了。我不能提供主題參數。Grails將參數傳遞給使用資源插件的模塊
我用這個標籤:
<r:use module="jquery" />
<r:use module="jquery-ui" theme="smoothness" />
但不工作,也試圖與themeCSS屬性並沒有什麼作用。
謝謝。
我正在使用Grails 1.3.7,我想同時使用資源插件以及jQuery UI,當我想切換到不同的jQuery UI UI主題時,問題就出現了。我不能提供主題參數。Grails將參數傳遞給使用資源插件的模塊
我用這個標籤:
<r:use module="jquery" />
<r:use module="jquery-ui" theme="smoothness" />
但不工作,也試圖與themeCSS屬性並沒有什麼作用。
謝謝。
我不知道爲什麼,這個插件是那麼的難,但無論如何,如果你想改變你需要指定(內側頭標記的)主題:
<jqui:resources themeCss="${g.resource(dir:'/css/jquery-ui/theme/smoothness', file:'jquery-ui-1.4.4.custom.css')}" />
比你需要把你的模板文件(css文件和圖像文件夾)到你的應用程序的css文件夾(web-app/css)。這應該可以工作
你可以在你自己的本地資源定義(如/conf/AppResources.groovy)中覆蓋默認的jquery-theme資源。要做到這一點,添加覆寫部分,如:
modules = {
...
overrides {
// this overrides the default ui-lightness theme from jquery-ui plugin
'jquery-theme' {
resource id:'theme', url:'/css/themes/my-theme/jquery-ui.custom.css', attrs: [media: 'screen, projection']
}
}
...
}
調整網址以相應地指向您從ThemeRoller下載的主題CSS。然後,只需使用
<r:require module="jquery-ui" />
jquery-ui模塊依賴於jquery-theme,並將根據您的重寫定義進行提取。