Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
- <%@ page contentType="text/html;charset=UTF-8"%>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
- <c:set var="vaSecPage" value="" scope="request"/>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
- <meta name="viewport" content="width=device-width, initial-scale=1"/>
- <title>Customer Information System</title>
- <%@ include file="../config/includeJsCss.inc" %>
- <style type="">
- .ui-blue
- {
- background-image: url(../libraries/jquery-ui/css/smoothness/images/ui-icons_2e83ff_256x240.png) !important;
- }
- .ui-red
- {
- background-image: url(../libraries/jquery-ui/css/smoothness/images/ui-icons_cd0a0a_256x240.png) !important;
- }
- </style>
- <%@ include file="../config/Repsev.inc" %>
- <script type="text/javascript" src=""></script>
- <script type="text/javascript">
- //<![CDATA[
- /*global $ */
- $(function () {
- "use strict";
- var myData = [
- {
- id: "10",
- c1: "My Value 1.1",
- c2: "My Value 1.2",
- c3: "My Value 1.3",
- c4: "My Value 1.4",
- subgridData: [
- { id: "10", c1: "aa", c2: "ab", c3: "ac", c4: "ad" },
- { id: "20", c1: "ba", c2: "bb", c3: "bc", c4: "bd" },
- { id: "30", c1: "ca", c2: "cb", c3: "cc", c4: "cd" }
- ]
- },
- {
- id: "20",
- c1: "My Value 2.1",
- c2: "My Value 2.2",
- c3: "My Value 2.3",
- c4: "My Value 2.4",
- subgridData: [
- { id: "10", c1: "da", c2: "db", c3: "dc", c4: "dd" },
- { id: "20", c1: "ea", c2: "eb", c3: "ec", c4: "ed" },
- { id: "30", c1: "fa", c2: "fb", c3: "fc", c4: "fd" }
- ]
- },
- {
- id: "30",
- c1: "My Value 3.1",
- c2: "My Value 3.2",
- c3: "My Value 3.3",
- c4: "My Value 3.4",
- subgridData: [
- { id: "10", c1: "ga", c2: "gb", c3: "gc", c4: "gd" },
- { id: "20", c1: "ha", c2: "hb", c3: "hc", c4: "hd" },
- { id: "30", c1: "ia", c2: "ib", c3: "ic", c4: "id" }
- ]
- }
- ],
- mainGridPrefix = "s_";
- $("#list").jqGrid({
- iconSet: "glyphIcon",
- datatype: "local",
- data: myData,
- colNames: ["Column 1", "Column 2", "Column 3", "Column 4"],
- colModel: [
- { name: "c1", width: 100 },
- { name: "c2", width: 130 },
- { name: "c3", width: 150 },
- { name: "c4", width: 170 }
- ],
- rowNum: 10,
- rowList: [5, 10, 20],
- pager: "#pager",
- gridview: true,
- ignoreCase: true,
- rownumbers: true,
- sortname: "c1",
- viewrecords: true,
- autoencode: true,
- height: "100%",
- idPrefix: mainGridPrefix,
- subGrid: true,
- subGridOptions: { "plusicon" : "ui-blue ui-icon-circle-plus",
- "minusicon" :"ui-red ui-icon-circle-minus",
- "openicon" : "",
- "reloadOnExpand" : false,
- "selectOnExpand" : true },
- subGridRowExpanded: function (subgridDivId, rowId) {
- var $subgrid = $("<table id='" + subgridDivId + "_t'></table>"),
- pureRowId = $.jgrid.stripPref(mainGridPrefix, rowId),
- colModel = $(this).jqGrid("getGridParam", "colModel");
- $subgrid.appendTo("#" + $.jgrid.jqID(subgridDivId));
- $subgrid.jqGrid({
- datatype: "local",
- data: $(this).jqGrid("getLocalRow", pureRowId).subgridData,
- colModel: [
- { name: "c1", width: (colModel[2].width - 2) },
- { name: "c2", width: colModel[3].width },
- { name: "c3", width: colModel[4].width },
- { name: "c2", width: (colModel[5].width - 2) }
- ],
- height: "100%",
- rowNum: 10000,
- autoencode: true,
- gridview: true,
- idPrefix: rowId + "_"
- });
- $subgrid.closest("div.ui-jqgrid-view")
- .children("div.ui-jqgrid-hdiv")
- .hide();
- },
- resizeStop: function (newWidth, index) {
- // grid.dragEnd()
- var widthChange = this.newWidth - this.width,
- $theGrid = $(this.bDiv).find(">div>.ui-jqgrid-btable"),
- $subgrids = $theGrid.find(">tbody>.ui-subgrid>.subgrid-data>.tablediv>.ui-jqgrid>.ui-jqgrid-view>.ui-jqgrid-bdiv>div>.ui-jqgrid-btable");
- $subgrids.each(function () {
- var grid = this.grid;
- // we have subgrids which have no internal subgrids
- // it reduce the number of columns to 1
- // we have rownumbers: true in the main grid, but not in subgrids
- // it reduce the number of columns to additional 1
- // so we should use (index - 2) as the column index in the subgrids
- grid.resizing = { idx: (index - 2) };
- grid.headers[index - 2].newWidth = (index - 2 === 0) || (index - 1 === grid.headers.length) ? newWidth - 2 : newWidth;
- grid.newWidth = grid.width + widthChange;
- grid.dragEnd.call(grid);
- $(this).jqGrid("setGridWidth", grid.newWidth, false);
- });
- $theGrid.jqGrid("setGridWidth", this.newWidth, false);
- }
- }).jqGrid("navGrid", "#pager", {add: false, edit: false, del: false});
- });
- //]]>
- </script>
- </head>
- <body>
- <table id="list"><tr><td></td></tr></table>
- <div id="pager"></div>
- <!--<fieldset class="fieldset" id='gridSearch'>
- <div class="form-group">
- <div id="grid_container">
- <table id="list" width="100%"><tr><td></td></tr></table>
- <div id="pager"></div>
- </div>
- </div>
- </fieldset>-->
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment