今天看到javaeye上有人使用了jqGrid实现了数据的分页,参考它的代码,实现了这个功能,搬出来晒晒,作为自己以后学习的资料!
(1)页面代码:
Html代码
html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Insert title herehref="js/themes/basic/grid.css"/>
jQuery(document).ready(function(){
jQuery("#myTab").jqGrid({
datatype: "json", //将这里改为使用JSON数据
url:'DataServlet', //这是Action的请求地址
mtype: 'POST',
height: 250,
width: 400,
colNames:['编号'