61 строка
2.6 KiB
HTML
61 строка
2.6 KiB
HTML
<!DOCTYPE html>
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>Essential JS 1 : StackedHeader</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<meta charset="utf-8" />
|
|
<link href="../content/bootstrap.min.css" rel="stylesheet" />
|
|
<link href="../content/ejthemes/default-theme/ej.web.all.min.css" rel="stylesheet" />
|
|
<link href="../content/default.css" rel="stylesheet" />
|
|
<link href="../content/default-responsive.css" rel="stylesheet" />
|
|
<link href="../content/ejthemes/responsive-css/ej.responsive.css" rel="stylesheet" />
|
|
<!--[if lt IE 9]>
|
|
<script src="../scripts/jquery-1.11.3.min.js"></script>
|
|
<![endif]-->
|
|
<!--[if gte IE 9]><!-->
|
|
<script src="../scripts/jquery-3.3.1.min.js"></script>
|
|
<!--<![endif]-->
|
|
<script src="../scripts/jsondata.min.js"></script>
|
|
<script src="../scripts/jsrender.min.js"></script>
|
|
<script src="../scripts/ej.web.all.min.js" type="text/javascript"></script>
|
|
<script src="../scripts/properties.js" type="text/javascript"></script>
|
|
|
|
</head>
|
|
<body>
|
|
<div class="content-container-fluid">
|
|
<div class="row">
|
|
<div class="cols-sample-area">
|
|
<div id="Grid"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
// the datasource "window.gridData" is referred from jsondata.min.js
|
|
var data = ej.DataManager(window.gridData).executeLocal(ej.Query().take(50));
|
|
$("#Grid").ejGrid({
|
|
dataSource: data,
|
|
allowPaging: true,
|
|
allowSorting: true,
|
|
showStackedHeader:true,
|
|
allowReordering:true,
|
|
allowResizing:true,
|
|
stackedHeaderRows:[{stackedHeaderColumns:[{headerText:"Order Details",column:"OrderID,OrderDate,Freight"}
|
|
,{headerText:"Ship Details",column:"ShipName,ShipCity,ShipCountry"}
|
|
]}
|
|
],
|
|
columns: [
|
|
|
|
{ field: "OrderID", headerText: "Order ID", width: 80 },
|
|
{ field: "OrderDate", headerText: "Order Date", width: 80, format: "{0:MM/dd/yyyy}", textAlign: ej.TextAlign.Right },
|
|
{ field: "Freight", width: 75, format: "{0:C}", textAlign: ej.TextAlign.Right },
|
|
{ field: "ShipName", headerText: "Ship Name", width: 110 },
|
|
{ field: "ShipCity", headerText: "Ship City", width: 110 },
|
|
{ field: "ShipCountry", headerText: "Ship Country", width: 110 }
|
|
]
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|