【问题标题】:gvNIX datatables set sorting options table (which fields)gvNIX datatables 设置排序选项表(哪些字段)
【发布时间】:2015-11-23 18:40:53
【问题描述】:

如何使用 gvNIX 数据表指定数据表的排序? 基于 Petclinic 样本的示例会很棒。

对于我的应用程序,我希望为每个表指定数据表中记录的排序顺序。

【问题讨论】:

    标签: datatables spring-roo gvnix


    【解决方案1】:

    锁定src/main/webapp/WEB-INF/tags/datatables/column.tagx 中支持的选项sortInitsortDirection 属性应该可以帮助您。

    <jsp:directive.attribute name="sortInit" 
          type="java.lang.String" required="false" rtexprvalue="true"
          description="(asc|desc) If sortable is enabled, set the default sorting direction (Default : asc)" />
    <jsp:directive.attribute name="sortDirection" 
          type="java.lang.String" required="false" rtexprvalue="true"
          description="((asc|desc)[,(asc|desc)[...]])If sortable is enabled, allow to control the sorting direction(s) (default 'asc,desc') (related to asSorting js-datatables columnDef)" />
    

    例如,在 list.jspx 上:

        <table:table data="${pets}" id="l_com_springsource_petclinic_domain_Pet" path="/pets" z="gvs425syhOX//lJjxIylimFQflM=">
            <table:column id="c_com_springsource_petclinic_domain_Pet_sendReminders"
                property="sendReminders" z="9OZRH4z6dmoKcOlx/Gs0++zdd/A="/>
            <table:column id="c_com_springsource_petclinic_domain_Pet_name" 
                property="name" sortInit="asc" z="USER-MANAGED"/>
            <table:column id="c_com_springsource_petclinic_domain_Pet_weight" property="weight" z="sDq86anRDnXzji8d7j+tb9X7coI="/>
            ....
            ....
        </table:table>
    

    我建议您查看所有 .tagx 文件。它的参数将显示您可以使用的所有受支持的选项和功能。

    祝你好运!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-05-16
      • 2013-12-14
      • 2018-08-03
      • 2020-01-25
      • 2013-04-26
      • 1970-01-01
      • 2021-10-06
      • 1970-01-01
      相关资源
      最近更新 更多