This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Example: Paginating Mapper-based snippets with sortable headers
import net.liftweb.mapper.view.Paginator
class Requests extends ModelSnippet[Request] {
// Parameters: the MetaMapper, default sort field, and (headerName, field) tuples
val paginator = new Paginator(Request, this, Request.id,
"id" -> Request.id,
"nature" -> Request.nature,
"client" -> Request.client,
"dispatcher" -> Request.dispatcher,
"priority" -> Request.priority,
"comment" -> Request.comment
)
def list(xhtml: NodeSeq) =
bind("prefix", paginator.paginate(xhtml), ... )
}
View
nav: prefix is for navigation links. allpages is the list of page numbers, linked. The ’ | ’ is used as the separator in this example; you can choose something else if you like.
In the table header use the sort prefix sortable headers. For example
<lift:surround with="default" at="content">
<lift:Requests.list>
<nav:records/>
<br/>
<nav:first/>
<nav:prev/> <nav:allpages> | </nav:allpages> <nav:next/>
<nav:last/>
<table rules="groups" frame="hsides">
<thead>
<th><sort:id>
<lift:loc>Req#</lift:loc>
</sort:id>
</th>
<th><sort:nature>
<lift:loc>Nature</lift:loc>
</sort:nature></th>
<th><sort:client>
<lift:loc>Client</lift:loc>
</sort:client></th>
<th><sort:dispatcher>
<lift:loc>Dispatcher</lift:loc>
</sort:dispatcher></th>
<th><sort:priority>
<lift:loc>Priority</lift:loc>
</sort:priority></th>
<th><sort:comment>
<lift:loc>Comments</lift:loc>
</sort:comment></th>
<th><lift:loc>Assigned volunteers</lift:loc></th>
</thead>
.....
</table>
</lift:Requests.list>
</lift:surround>






