0

I am making some modifications to the spring petclinic application, and I need to place the pagination control for a dandelion datatable at the bottom, underneath the table. The filter needs to be at top, and users will almost always filter results to less than 10 records, so the pagination controls can safely be at the bottom. How do I accomplish this? What specific changes do I make to the code below to make this happen?

Here is the link:

Here is my current code for the datatable, which produces the jumbled results shown above. How do I change it so that the pagination control (select number of results) is on the bottom, with the filter criteria box remaining on top?

<datatables:table id="owners" data="${selections}" cdn="true" row="owner" theme="bootstrap2" 
                  cssClass="table table-striped" paginate="true" info="false" 
                  cssStyle="width: 150px;" align="left" >
<datatables:column title="Name" cssStyle="width: 150px;" display="html">
    <spring:url value="/owners?ownerID={ownerId}" var="ownerUrl">
        <spring:param name="ownerId" value="${owner.id}"/>
    </spring:url>
    <a href="${fn:escapeXml(ownerUrl)}"><c:out value="${owner.firstName} ${owner.lastName}"/></a>
</datatables:column>
</datatables:table>

Note: Hiding the dropdown that selects the number of records per page would also be acceptable, as long as the number defaults to 10 and as long as the arrow buttons to scroll through pages remain at the bottom.

Community
  • 1
  • 1
CodeMed
  • 9,527
  • 70
  • 212
  • 364

1 Answers1

1

You can play with the dom table attribute (and probably a bit of CSS) to move controls around the table. You can find the original reference here.

<datatables:table id="owners" data="${selections}" ... dom="frtp" >
    ...
</datatables:table>
tduchateau
  • 4,351
  • 2
  • 29
  • 40
  • You're welcome! Sorry for the delay, it would be much easier to me to track questions if I could create a tag! :-) – tduchateau Dec 31 '13 at 00:33
  • Beaten by @Gautam :-) – tduchateau May 12 '14 at 22:05
  • I am trying to get the search box in the dandelion datatable to only populate the table if the user has entered at least 3 characters in the search box. Are you willing to help me with this subsequent question? here is the link: http://stackoverflow.com/questions/23662863/speed-up-data-access-in-a-search-form – CodeMed May 14 '14 at 21:19
  • I create a second new posting focusing on the ehcache aspect of the problem. Since it is all related to an attempt to find a simple way of using a dandelion datatable to filter a large dataset, I am asking your help. Are you willing to help me find a solution to both of these related postings? Here is the link to the second new posting: http://stackoverflow.com/questions/23667447/configuring-ehcache-to-load-a-dataset – CodeMed May 15 '14 at 00:45