热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

基于velocity的分页组件

<formmethodgetmethodpostactionmes
"get" id="frm_search" class="form-inlineheadBar"  method="post" action="/messageTaskList.htm">
"hidden" name="page" id= "page" value="$!page" />
"hidden" name="pageSize" value= "2" >
"hidden" name="totalCount" value="$!totalCount" >


#set( $current_page_num = $paginator.page)
#if(! $current_page_num)
#set($current_page_num = 0)
#end
#set( $itemsPerpage = $paginator.itemsPerPage)
#if(! $itemsPerpage)
#set($itemsPerpage = 0)
#end

#set( $total_page_num = $paginator.getPages())
#if(! $total_page_num)
#set($total_page_num = 0)
#end

#set( $beginIndex = $paginator.beginIndex)
#if(! $beginIndex)
#set($beginIndex = 0)
#end

#set( $endIndex = $paginator.endIndex)
#if(! $endIndex)
#set($endIndex = 0)
#end

#set( $items = $paginator.items)
#if(! $items)
#set($items = 0)
#end

#set( $btn_go_status = "")
#if( $items == 0)
#set($btn_go_status = "disabled")
#end

#set( $tmp_page_num = 0)
#set( $pre_page = 0)
#set( $next_page = 0)

"t-pagination" >





"53%" class="pages" >
#if( $current_page_num > 1)
[ "Javascript:gotoPage($!total_page_num, 1)">最前页 ]
#else
[最前页]
#end

#if( $current_page_num > 1)
#set( $pre_page = $current_page_num - 1)
[ "Javascript:gotoPage($!total_page_num, $pre_page)">上一页 ]
#else
[上一页]
#end

#if( $current_page_num <$total_page_num)
#set( $next_page = $current_page_num + 1)
["Javascript:gotoPage($!total_page_num, $next_page)">下一页 ]
#else
[下一页]
#end
#if( $current_page_num <$total_page_num)
["Javascript:gotoPage($!total_page_num, $total_page_num)">最末页 ]

#else
[最末页]
#end

[页数 $current_page_num of $total_page_num]

#if( $current_page_num > 3 && $total_page_num > 5)
 ... 
#end

#set( $tmp_page_num = $current_page_num - 4)
#if( $tmp_page_num > 0 && $total_page_num - $current_page_num <1)
[ "Javascript:gotoPage($!total_page_num, $!tmp_page_num)">$!tmp_page_num ]
#end

#set( $tmp_page_num = $current_page_num - 3)
#if( $tmp_page_num > 0 && $total_page_num - $current_page_num <2)
[
"Javascript:gotoPage($!total_page_num, $!tmp_page_num)"
>$!tmp_page_num ]
#end

#set( $tmp_page_num = $current_page_num - 2)
#if( $tmp_page_num > 0)
[
"Javascript:gotoPage($!total_page_num, $!tmp_page_num)"
>$!tmp_page_num ]
#end

#set( $tmp_page_num = $current_page_num - 1)
#if( $tmp_page_num > 0)
[
"Javascript:gotoPage($!total_page_num, $!tmp_page_num)">$!tmp_page_num ]
#end

#if( $current_page_num > 0)
"curent-pagenum"> [$current_page_num ]
#end

#set( $tmp_page_num = $current_page_num + 1)
#if( $tmp_page_num <= $total_page_num)
[
"Javascript:gotoPage($!total_page_num, $!tmp_page_num)">$!tmp_page_num ]
#end

#set( $tmp_page_num = $current_page_num + 2)
#if( $tmp_page_num <= $total_page_num)
[
"Javascript:gotoPage($!total_page_num, $!tmp_page_num)">$!tmp_page_num ]
#end

#set( $tmp_page_num = $current_page_num + 3)
#if( $tmp_page_num <= $total_page_num && $current_page_num <= 2)
[
"Javascript:gotoPage($!total_page_num, $!tmp_page_num)">$!tmp_page_num ]
#end

#set( $tmp_page_num = $current_page_num + 4)
#if( $tmp_page_num <= $total_page_num && $current_page_num <= 1)
[
"Javascript:gotoPage($!total_page_num, $!tmp_page_num)">$!tmp_page_num ]
#end

#if( $current_page_num + 2 <$total_page_num && $total_page_num > 5)
 ... 
#end
"19%">"font11">跳页:
"page_num" class="page-num" type= "text" size="3" value="$current_page_num" >
"button" value="GO" OnClick="Javascript:gotoPage2($!total_page_num,this.parentNode)" $btn_go_status>
"28%">
"right">显示记录: $!beginIndex - $!endIndex Of $!items  



推荐阅读
author-avatar
手机用户2502895293
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有