pacozaa

jqgrid-custom-icon-eiei

Dec 12th, 2015
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.42 KB | None | 0 0
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <%@ page contentType="text/html;charset=UTF-8"%>
  4. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  5. <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
  6.  
  7. <c:set var="vaSecPage" value="" scope="request"/>
  8.  
  9. <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  12. <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  13. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  14. <title>Customer Information System</title>
  15. <%@ include file="../config/includeJsCss.inc" %>
  16. <style type="">
  17. .ui-blue
  18. {
  19. background-image: url(../libraries/jquery-ui/css/smoothness/images/ui-icons_2e83ff_256x240.png) !important;
  20. }
  21. .ui-red
  22. {
  23. background-image: url(../libraries/jquery-ui/css/smoothness/images/ui-icons_cd0a0a_256x240.png) !important;
  24. }
  25. </style>
  26. <%@ include file="../config/Repsev.inc" %>
  27. <script type="text/javascript" src=""></script>
  28. <script type="text/javascript">
  29.  
  30.  
  31. //<![CDATA[
  32. /*global $ */
  33. $(function () {
  34. "use strict";
  35. var myData = [
  36. {
  37. id: "10",
  38. c1: "My Value 1.1",
  39. c2: "My Value 1.2",
  40. c3: "My Value 1.3",
  41. c4: "My Value 1.4",
  42. subgridData: [
  43. { id: "10", c1: "aa", c2: "ab", c3: "ac", c4: "ad" },
  44. { id: "20", c1: "ba", c2: "bb", c3: "bc", c4: "bd" },
  45. { id: "30", c1: "ca", c2: "cb", c3: "cc", c4: "cd" }
  46. ]
  47. },
  48. {
  49. id: "20",
  50. c1: "My Value 2.1",
  51. c2: "My Value 2.2",
  52. c3: "My Value 2.3",
  53. c4: "My Value 2.4",
  54. subgridData: [
  55. { id: "10", c1: "da", c2: "db", c3: "dc", c4: "dd" },
  56. { id: "20", c1: "ea", c2: "eb", c3: "ec", c4: "ed" },
  57. { id: "30", c1: "fa", c2: "fb", c3: "fc", c4: "fd" }
  58. ]
  59. },
  60. {
  61. id: "30",
  62. c1: "My Value 3.1",
  63. c2: "My Value 3.2",
  64. c3: "My Value 3.3",
  65. c4: "My Value 3.4",
  66. subgridData: [
  67. { id: "10", c1: "ga", c2: "gb", c3: "gc", c4: "gd" },
  68. { id: "20", c1: "ha", c2: "hb", c3: "hc", c4: "hd" },
  69. { id: "30", c1: "ia", c2: "ib", c3: "ic", c4: "id" }
  70. ]
  71. }
  72. ],
  73. mainGridPrefix = "s_";
  74.  
  75. $("#list").jqGrid({
  76. iconSet: "glyphIcon",
  77. datatype: "local",
  78. data: myData,
  79. colNames: ["Column 1", "Column 2", "Column 3", "Column 4"],
  80. colModel: [
  81. { name: "c1", width: 100 },
  82. { name: "c2", width: 130 },
  83. { name: "c3", width: 150 },
  84. { name: "c4", width: 170 }
  85. ],
  86. rowNum: 10,
  87. rowList: [5, 10, 20],
  88. pager: "#pager",
  89. gridview: true,
  90. ignoreCase: true,
  91. rownumbers: true,
  92. sortname: "c1",
  93. viewrecords: true,
  94. autoencode: true,
  95. height: "100%",
  96. idPrefix: mainGridPrefix,
  97. subGrid: true,
  98. subGridOptions: { "plusicon" : "ui-blue ui-icon-circle-plus",
  99. "minusicon" :"ui-red ui-icon-circle-minus",
  100. "openicon" : "",
  101. "reloadOnExpand" : false,
  102. "selectOnExpand" : true },
  103. subGridRowExpanded: function (subgridDivId, rowId) {
  104. var $subgrid = $("<table id='" + subgridDivId + "_t'></table>"),
  105. pureRowId = $.jgrid.stripPref(mainGridPrefix, rowId),
  106. colModel = $(this).jqGrid("getGridParam", "colModel");
  107.  
  108. $subgrid.appendTo("#" + $.jgrid.jqID(subgridDivId));
  109. $subgrid.jqGrid({
  110. datatype: "local",
  111. data: $(this).jqGrid("getLocalRow", pureRowId).subgridData,
  112. colModel: [
  113. { name: "c1", width: (colModel[2].width - 2) },
  114. { name: "c2", width: colModel[3].width },
  115. { name: "c3", width: colModel[4].width },
  116. { name: "c2", width: (colModel[5].width - 2) }
  117. ],
  118. height: "100%",
  119. rowNum: 10000,
  120. autoencode: true,
  121. gridview: true,
  122. idPrefix: rowId + "_"
  123. });
  124. $subgrid.closest("div.ui-jqgrid-view")
  125. .children("div.ui-jqgrid-hdiv")
  126. .hide();
  127. },
  128. resizeStop: function (newWidth, index) {
  129. // grid.dragEnd()
  130. var widthChange = this.newWidth - this.width,
  131. $theGrid = $(this.bDiv).find(">div>.ui-jqgrid-btable"),
  132. $subgrids = $theGrid.find(">tbody>.ui-subgrid>.subgrid-data>.tablediv>.ui-jqgrid>.ui-jqgrid-view>.ui-jqgrid-bdiv>div>.ui-jqgrid-btable");
  133. $subgrids.each(function () {
  134. var grid = this.grid;
  135. // we have subgrids which have no internal subgrids
  136. // it reduce the number of columns to 1
  137. // we have rownumbers: true in the main grid, but not in subgrids
  138. // it reduce the number of columns to additional 1
  139. // so we should use (index - 2) as the column index in the subgrids
  140. grid.resizing = { idx: (index - 2) };
  141. grid.headers[index - 2].newWidth = (index - 2 === 0) || (index - 1 === grid.headers.length) ? newWidth - 2 : newWidth;
  142. grid.newWidth = grid.width + widthChange;
  143. grid.dragEnd.call(grid);
  144. $(this).jqGrid("setGridWidth", grid.newWidth, false);
  145. });
  146. $theGrid.jqGrid("setGridWidth", this.newWidth, false);
  147. }
  148. }).jqGrid("navGrid", "#pager", {add: false, edit: false, del: false});
  149. });
  150. //]]>
  151. </script>
  152.  
  153. </head>
  154. <body>
  155.  
  156. <table id="list"><tr><td></td></tr></table>
  157. <div id="pager"></div>
  158.  
  159. <!--<fieldset class="fieldset" id='gridSearch'>
  160. <div class="form-group">
  161. <div id="grid_container">
  162. <table id="list" width="100%"><tr><td></td></tr></table>
  163. <div id="pager"></div>
  164. </div>
  165. </div>
  166. </fieldset>-->
  167. </body>
  168. </html>
Advertisement
Add Comment
Please, Sign In to add comment