I have to choose between the normal Table and the Livetable.
I like the possibility to make select boxes with the normal table (using:
class="unsortable selectFilter")
But I have problems with the filtering. If I add pagination and use the
filter field he shows me only the results of the current page.
Livetable finds all pages but I can't make such Filter-Boxes.
Please tell me if I did something wrong with the normal table!
Here is my code:
## The full data to display
#set ($spaceDocs = $xwiki.getSpaceDocsName("Projects-Todo"))
#set($itemsPerPage = 3)
#if($request.ipp)
#set($itemsPerPage = $xwiki.parseInt($request.ipp))
#end
#set($pageNumber = 0)
#if($request.page)
#set($pageNumber = $xwiki.parseInt($request.page))
#end
#set($startAt = $itemsPerPage * $pageNumber)
#if($startAt < 0)
#set($startAt = 0)
#end
#set($endAt = $itemsPerPage * ($pageNumber + 1))
#if($endAt > $spaceDocs.size())
#set($endAt = $spaceDocs.size())
#end
#if($startAt > $endAt)
#set($startAt = $endAt)
#end
#set($totalPages = ($spaceDocs.size() - 1) / $itemsPerPage)
#set($crtPageNumber = $startAt / $itemsPerPage)
#set($spaceDocsInPage = $spaceDocs.subList($startAt, $endAt))
#set ($hql = ", BaseObject as obj where obj.name=doc.fullName
and obj.className='XWiki.Todo2Class' and
obj.name<>'XWiki.Todo2Template'
order by doc.date desc")
#set ($todos= $xwiki.searchDocuments($hql, $itemsPerPage, $startAt))
<table id="todoTable" class="grid sortable filterable doOddEven"
cellpadding="0" cellspacing="0" border="0">
<tr class="sortHeader">
<th>Page</th>
<th>Description</th>
<th class="unsortable selectFilter">Priority</th>
<th class="unsortable selectFilter">Status</th>
<th>Date</th>
</tr>
#foreach ($todo in $todos)
<tr>
#set ($todoDoc = $xwiki.getDocument($todo))
#set ($todoObj = $todoDoc.getObject("XWiki.Todo2Class"))
<td>[$todo]</td>
<td>$todoObj.Description</td>
<td>$todoObj.Priority</td>
<td>$todoObj.Status</td>
<td>$todoObj.Date</td>
</tr>
#end
</table>
--
View this message in context:
http://xwiki.475771.n2.nabble.com/Table-Pagination-Filtering-capabilities-t…
Sent from the XWiki- Users mailing list archive at
Nabble.com.