【问题标题】:dandelion datatables spring mvc runtime themeoption蒲公英数据表spring mvc运行时主题选项
【发布时间】:2015-04-28 04:30:33
【问题描述】:

我正在尝试在蒲公英datatables 中使用 jqueryui 主题。所以我从这个link开始。但是,我们可以在运行时传递themeoption 吗?

<datatables:table id="users" data="${list}" row="user"
     rowIdBase="userId" rowIdPrefix="person_"  pageable="true" displayLength="5"       
     filterable="true"  processing="true" autoWidth="true" 
     theme="jqueryui" 
     themeOption="<spring:theme code="theme"/>" 

<datatables:table id="users" data="${list}" row="user"
     rowIdBase="userId" rowIdPrefix="person_"  pageable="true" displayLength="5"       
     filterable="true"  processing="true" autoWidth="true" 
     theme="jqueryui" 
     themeOption="<c:out value="theme"/>" 

我想使用 spring 主题。我正在使用themeResolverthemeChangeInterceptordatatables的主题我什么时候换主题会变吗?

在我的theme-default.properties 文件中

css=themes/blue/style.css
theme=start

我的主题名称是 defaultgreenorangepurplered

我想使用datatables的主题分别是startsouthstreethumanitypeppergrinderflick

我怎样才能做到这一点?

【问题讨论】:

    标签: spring-mvc themes datatables jquery-ui-theme dandelion


    【解决方案1】:

    所有标签属性都接受运行时表达式值。

    也许您应该尝试以下语法:

    示例 1:

    <spring:theme code="theme" var="springTheme" />
    <datatables:table id="users" data="${list}" row="user"
         rowIdBase="userId" rowIdPrefix="person_"  pageable="true" displayLength="5"       
         filterable="true"  processing="true" autoWidth="true" 
         theme="jqueryui" 
         themeOption="${springTheme}">
         ...
    </datatables:table>
    

    示例 2:

    <datatables:table id="users" data="${list}" row="user"
         rowIdBase="userId" rowIdPrefix="person_"  pageable="true" displayLength="5"       
         filterable="true"  processing="true" autoWidth="true" 
         theme="jqueryui" 
         themeOption="${theme}">
        ...
    </datatables>
    

    (StackOverflow 要求的免责声明:我是蒲公英的作者)

    【讨论】:

    • 示例 1 对我有用...非常感谢...你能给我推荐 redcolor css 的任何主题吗???
    • 如果我想的话,还告诉我如何使用自定义主题......提前谢谢你......
    • Dandelion-Datatables 支持从 ThemeRoller 到组合的所有主题:theme="jqueryui" / themeOption="sunny",例如 docs here
    • 如何应用从jqueryui.com/themeroller 下载的名为Purpletheme 的自己的主题??
    • 请为此创建另一个问题 ;-)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-08
    • 1970-01-01
    • 2014-07-22
    • 1970-01-01
    • 1970-01-01
    • 2014-06-30
    相关资源
    最近更新 更多