教程集 www.jiaochengji.com
教程集 >  脚本编程  >  java  >  正文 基于JQuery中jqGrid分页实现代码

基于JQuery中jqGrid分页实现代码

发布时间:2017-12-08   编辑:jiaochengji.com
教程集为您提供基于JQuery中jqGrid分页实现代码等资源,欢迎您收藏本站,我们将为您提供最新的基于JQuery中jqGrid分页实现代码资源
提供一篇关于jsp中利用jquery jqgrid实现简单的分页功能,有需要的朋友可以参考一下。
<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy4414')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy4414><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  
<html>  
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
<title>Insert title here</title>  
<link rel="stylesheet" type="text/分页工具栏,pager:分页DIV的id  
        imgpath: 'js/themes/basic/images', //图片存放路径   
        rowNum:10, //每页显示记录数   
        viewrecords: true, //是否显示行数   
        rowList:[10,20,30], //可调整每页显示的记录数   
        multiselect: false, //是否支持多选   
        caption: "信息显示"   
    });   
});   
</script>  
</head>  
<body>  
<table id="myTab" class="scroll" cellpadding="0" cellspacing="0"></table>  
<div id="pager" class="scroll"></div>  
</body>  
</html>  


后台的servlet,里面的数据是模拟的

Java代码 
  

<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy8124')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy8124>public class DataServlet extends HttpServlet {   
    private static final long serialVersionUID = 1L;   
  
      
    protected void doGet(HttpServletRequest request,   
            HttpServletResponse response) throws ServletException, IOException {   
        // TODO Auto-generated method stub   
    }   
  
      
    protected void doPost(HttpServletRequest request,   
            HttpServletResponse response) throws ServletException, IOException {   
        String page = request.getParameter("page"); // 取得当前页数,注意这是jqgrid自身的参数   
        String rows = request.getParameter("rows"); // 取得每页显示行数,,注意这是jqgrid自身的参数   
        int totalRecord = 80; // 总记录数(应根据catch (Exception ex) {   
        }   
    }   
}  

您可能感兴趣的文章:
jqgrid 简单学习笔记
JqGrid web打印实现代码
jquery下动态显示jqGrid以及jqGrid的属性设置容易出现问题的解决方法
基于JQuery中jqGrid分页实现代码
jQuery中jqGrid分页实现代码
jQuery jqgrid 对含特殊字符json 数据的 Java 处理方法
一个关于jqGrid使用的小例子(行按钮)
Jqgrid设置全选(选择)及获取选择行的值示例代码
jqGrid jQuery 表格插件测试代码
jQuery插件 tabBox实现代码

[关闭]
~ ~