jqgrid1.jsp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <%@ page language="java" contentType="text/html;charset=utf-8"%>
  2. <%@include file="/pages/includes/taglibs.jsp"%>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
  4. <html>
  5. <head>
  6. <script type="text/javascript" src="<%=request.getContextPath() %>/resource/js/jquery-1.8.3.js"></script>
  7. <script type="text/ecmascript" src="<%=request.getContextPath() %>/resource/plugin/jqgrid/js/jquery.jqGrid.min.js"></script>
  8. <script type="text/ecmascript" src="<%=request.getContextPath() %>/resource/plugin/jqgrid/js/i18n/grid.locale-cn.js"></script>
  9. <script type="text/ecmascript" src="<%=request.getContextPath()%>/pages/system/jqgrid.js"></script>
  10. <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/resource/plugin/jqueryui/css/custom-theme/jquery-ui-1.9.2.custom.css" />
  11. <link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/resource/plugin/jqgrid/css/ui.jqgrid.css" />
  12. <script type='text/javascript'>
  13. $(document).ready(function () {
  14. showJqGrid();
  15. });
  16. function showJqGrid() {
  17. var id = 'gridTable';
  18. var url = '<%=request.getContextPath() %>/wpAjax.action';
  19. var datatype = 'json';
  20. var colNames = ['ID', '日期','速度'];
  21. var colModel = [
  22. { name: 'id', index: 'id'},
  23. {
  24. name: 'name', index: 'name', width: 200, align: 'center'
  25. },
  26. {
  27. name: 'code', index: 'code', width: 250, align: 'center'
  28. }
  29. ];
  30. var caption = '风电场';
  31. var sortname = 'ID';
  32. var gridPagerID = 'gridPager';
  33. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID);
  34. }
  35. </script>
  36. </head>
  37. <body>
  38. <form id='form1' >
  39. <table id='gridTable'>
  40. </table>
  41. <div id='gridPager'>
  42. </div>
  43. </form>
  44. </body>
  45. </html>