The easydemo1.jsp page code is as follows: <%@ page language= "java" import= "java.util.*" pageencoding= "UTF-8"%> <% String path = Request.getcontextpath (); String basepath = request.getscheme () + "://" +request.getservername () + ":" +request.getserverport () +path+ "/"; %> <! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" > <base href= "<%=basePath%>" >
<title>easyDemo1.jsp</title> <link rel= "stylesheet" type= "Text/css" href= "Jquery-easyui/themes/default/easyui.css" > <link rel= "stylesheet" type= "Text/css" href= "Jquery-easyui/themes/icon.css" > <script type= "Text/javascript" src= "Jquery-easyui/jquery-1.4.2.min.js" ></script> <script type= "Text/javascript" src= "Jquery-easyui/jquery.easyui.min.js" ></script>
<script type= "Text/javascript" src= "Jslib/easydemo.js" ></script> <script type= "Text/javascript" > $ (function () { $ (' #tt '). DataGrid ({ Title: ' Small example of the DataGrid ', Iconcls: ' Icon-ok ', WIDTH:500, height:320, Pagesize:5, PAGELIST:[5,10,15,20], Nowrap:false, Striped:true, Collapsible:true, URL: ' Easyaction.action ', LOADMSG: ' Data loading ... ', Sortname: ' Code ', SortOrder: ' Desc ', Remotesort:false, frozencolumns:[[ {field: ' CK ', checkbox:true} ]], columns:[[ {title: ' Study Number ', field: ' ID ', Width: ' + ', rowspan:2,align: ' Center '}, {title: ' Name ', field: ' Name ', Width: ' $ ', rowspan:2,align: ' Center '}, {title: ' Sex ', field: ' Sex ', Width: ' + ', rowspan:2,align: ' Center '}, {title: ' Ages ', field: ' Age ', Width: ' + ', rowspan:2,align: ' Center '}, {title: ' Date of birth ', field: ' Birthday ', Width: ' + ', rowspan:2,align: ' Center '}, {title: ' Class ', field: ' ClassName ', Width: ' + ', rowspan:2,align: ' Center '} ]], Pagination:true, Rownumbers:true
}); $ (' #tt '). DataGrid (' Getpager '). Pagination ({ Displaymsg: ' current display from {-} to {-} total} Records ', Onbeforerefresh:function (pagenumber, pageSize) { $ (this). Pagination (' loading '); Alert (' pagenumber: ' +pagenumber+ ', pageSize: ' +pagesize '); $ (this). Pagination (' loaded '); }, });
$ (' #tt '). DataGrid ({url: ' easyaction.action '}); }); </script>
<body> <a href= "javascript:void (0)" onclick= "Verify ()" Class= "Easyui-linkbutton" > Test josn Data </a> <table id= "tt" > </table> </body>
|