宝哥软件园

jquery.pagination.js分页使用教程

编辑:宝哥软件园 来源:互联网 时间:2021-08-29

简单介绍一下在动态网页里面的jquery.pagination.js分页的使用,具体内容如下

添加下载的射流研究…和样式,主要是先添加jquery.js再添加jquery.pagination.js,我这是下载好的,放在本地

链接rel='样式表href=' %=路径% CSS/分页。CSS ' type=' text/CSS '脚本类型=' text/JavaScript ' src=' http :%=路径% js/jquery-1。11 .3 .js/script脚本类型=' text/JavaScript ' src=' http :%=路径% js/jquery。分页。js '/脚本表格,用的是c标签,获取控制器传过来的值

表格宽度='1052 '边框=0对齐=中心单元格填充=2单元格间距=1 border color=' # 799 ae1 ' class=TableBorder t body tr th对齐=中心col span=16 style=' height : 23px '商品显示/th/tr/tr align=' center ' bgcolor=' # 799 ae1 ' style=' height :28 px ' TD width=' 10% ' align=' center ' class=txlheadbackgroundalternate商品编号/TD TD TD宽度=' 10% ' align=' center ' class=Txlheaderbackgroundalternate商品大类/TD TD TD宽度=' 10% ' align=' center ' class=Txlheaderbackgroundalternate商品名称/TD TD TD宽度=' 10% ' align=' center ' class=Txlheaderbackgroundalternate商品规格/TD TD TD宽度=' 10% '对齐='中心' class=Txlheaderbackgroundalternate加权进价/TD TD TD宽度=' 10% ' align=' center ' class=Txlheaderbackgroundalternate当前售价/TD TD TD宽度=' 10% ' align=' center ' class=Txlheaderbackgroundalternate操作/TD/tr c : for each items=' $ { goods } ' var=' goods ' tr bgcolor=' # DEE5FA ' TD align=' center ' id=' goods id ' class=' txlrow ' c : out值=' $ {货物。 货物id } '/c : out/TD TD TD align=center id='货物类型' class=txlrowc : out值=' $ {货物。货物类型} '/c : out/TD align=中心id编辑/TD/tr/c : foreach/t车身/桌子!-分页显示- div id='Pagination'/divjs

var限制=%=请求。GetAttribute(' limit ')%;//每页显示多少条数据var计数=%=请求。GetAttribute(' count ')%//共多少条数据var索引=%=请求。GetAttribute(' index ')%;//当前记录数$(function(){ $('#Pagination ')).分页(计数,{ items_per_page:limit,//每页显示多少条记录current_page: Math.ceil(索引/限制),//当前页num _ display _ entries:4,//分页显示的条目数next_text: '下一页,prev_text: '上一页,num _ edge _ entries:2,//连接分页主体,显示的条目数回调: handlepaging click });});函数handlePaginationClick(new _ page _ index,pagination _ container){ var path=' %=ppath %/goodsManager/search goodsbylimit/' new _ page _ index * limit;$('#goodsForm ').attr('action ',path);$('#goodsForm ').submit();返回false}控制器

@RequestMapping(值='/searchegodbylimit/{ index } ')公共字符串searchGoodsBylimitPst(模型模型,@模型属性商品商品,@PathVariable字符串索引,HttpServletRequest请求){ //索引if(index==null | | index。equals('){ index=' 0 ';//从服务器获取数据列表商品=商品服务。选择商品(商品,整数。解析器(索引),页面参数。极限);如果(goodsS!=null){ model。addAttribute('货物',商品);} else { model。addattribute(' resultMsg ','没有该商品');} //数据总条数int count=goodservice。选择所有计数(货物);model.addAttribute('index ',index);model.addAttribute('count ',count);model.addAttribute('limit ',page param。极限);System.out.println('第'索引'数据开始显示goodsS.size()'条记录');返回"商品管理器/展示商品";}效果图

以上就是本文的全部内容。希望对大家的学习有帮助,支持我们。

更多资讯
游戏推荐
更多+