我的网页上有一个jquery网格组件。我想改变css文件,它使用。我在jj:head标签中设置了它:
<sj:head jqueryui="true" jquerytheme="custom-theme" customBasepath="css"/>我在我的网页上看到了这个html标签:
<link type="text/css" href="css/custom-theme/jquery-ui.css" rel="stylesheet" id="jquery_theme_link">jquery-grid组件的样式文件路径为
<link rel="stylesheet" type="text/css" href="/appname/struts/themes/ui.jqgrid.css">我希望这条路径是这样的:
<link rel="stylesheet" type="text/css" href="css/custom-theme/ui.jqgrid.css">我可以在哪里设置struts jquery网格css文件的位置?
发布于 2013-11-11 22:42:06
我也遇到了同样的问题,解决方案是在网格加载完成后覆盖css。
<sjg:grid
...
onCompleteTopics="loadCustomCss"
...
/>然后在您的jsp中
<script>
$.subscribe('loadCustomCss', function(event,data){
$('head').append( $('<link rel="stylesheet" type="text/css" />').attr('href', '../css/grid.css') );
});
</script>其中grid.css是您的自定义css,您可以复制插件提供的css,当您将其作为Maven依赖项加载时,这一点尤其有用。
发布于 2014-01-11 20:15:50
您可以执行以下操作:
<sjg:grid ... onGridCompleteTopics="myCssLoaderTopic" ....> 然后在你的主题中
<script>
$.subscribe('loadCustomCss', function(event,data){
$.struts2-jquery.requireCss(cssFile, basePath);
});
</script>请访问:https://groups.google.com/forum/#!topic/struts2-jquery/Aurqeuwhiuo
https://stackoverflow.com/questions/8741336
复制相似问题