列排序以在显示中包含全部内容 table
Column sorting to include entire content in display table
我正在使用 sortable="true"
进行分页显示 table 的列级别排序,但是当我单击 header 时,它仅对当前页面内容进行排序。当我转到下一页时,内容仍然像以前一样没有任何排序。单击 header 列时,是否可以对显示 table 的全部内容进行排序?下面是显示我的显示 table.
的代码
<display:table class="displayTable" id="person" name="persons" requestURI="personDetails" export="true" pagesize="10" requestURIcontext="false">
<display:column style="width: 30%; border: 1px solid #000;" title="Date" sortable="true">
<fmt:formatDate pattern="dd/MM/yyyy HH:mm:ss" value="${person.reportDate}" />
</display:column>
<display:column style="width: 30%; border: 1px solid #000;" property="personName" title="Name" sortable="true"/>
<display:column style="width: 30%; border: 1px solid #000;" property="personAge" title="Age" sortable="true"/>
</display:table>
我有办法。在 display:table 标签中添加 sort="list" 属性以将整个列表包含在排序中,如果不是只对显示的当前页面进行排序。
<display:table sort="list" class="displayTable" id="person" name="persons" requestURI="personDetails" export="true" pagesize="10" requestURIcontext="false" >
<display:column style="width: 30%; border: 1px solid #000;" title="Date" sortable="true">
<fmt:formatDate pattern="dd/MM/yyyy HH:mm:ss" value="${person.reportDate}" />
</display:column>
<display:column style="width: 30%; border: 1px solid #000;" property="personName" title="Name" sortable="true"/>
<display:column style="width: 30%; border: 1px solid #000;" property="personAge" title="Age" sortable="true"/>
</display:table>
我正在使用 sortable="true"
进行分页显示 table 的列级别排序,但是当我单击 header 时,它仅对当前页面内容进行排序。当我转到下一页时,内容仍然像以前一样没有任何排序。单击 header 列时,是否可以对显示 table 的全部内容进行排序?下面是显示我的显示 table.
<display:table class="displayTable" id="person" name="persons" requestURI="personDetails" export="true" pagesize="10" requestURIcontext="false">
<display:column style="width: 30%; border: 1px solid #000;" title="Date" sortable="true">
<fmt:formatDate pattern="dd/MM/yyyy HH:mm:ss" value="${person.reportDate}" />
</display:column>
<display:column style="width: 30%; border: 1px solid #000;" property="personName" title="Name" sortable="true"/>
<display:column style="width: 30%; border: 1px solid #000;" property="personAge" title="Age" sortable="true"/>
</display:table>
我有办法。在 display:table 标签中添加 sort="list" 属性以将整个列表包含在排序中,如果不是只对显示的当前页面进行排序。
<display:table sort="list" class="displayTable" id="person" name="persons" requestURI="personDetails" export="true" pagesize="10" requestURIcontext="false" >
<display:column style="width: 30%; border: 1px solid #000;" title="Date" sortable="true">
<fmt:formatDate pattern="dd/MM/yyyy HH:mm:ss" value="${person.reportDate}" />
</display:column>
<display:column style="width: 30%; border: 1px solid #000;" property="personName" title="Name" sortable="true"/>
<display:column style="width: 30%; border: 1px solid #000;" property="personAge" title="Age" sortable="true"/>
</display:table>