【发布时间】:2015-11-23 18:40:53
【问题描述】:
如何使用 gvNIX 数据表指定数据表的排序? 基于 Petclinic 样本的示例会很棒。
对于我的应用程序,我希望为每个表指定数据表中记录的排序顺序。
【问题讨论】:
标签: datatables spring-roo gvnix
如何使用 gvNIX 数据表指定数据表的排序? 基于 Petclinic 样本的示例会很棒。
对于我的应用程序,我希望为每个表指定数据表中记录的排序顺序。
【问题讨论】:
标签: datatables spring-roo gvnix
锁定src/main/webapp/WEB-INF/tags/datatables/column.tagx 中支持的选项sortInit 和sortDirection 属性应该可以帮助您。
<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 文件。它的参数将显示您可以使用的所有受支持的选项和功能。
祝你好运!
【讨论】: