javascript-ej1-demos/grid/gridcolumntemplate.html

61 строка
2.9 KiB
HTML

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 1 : Column Template</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.4.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>
<style type="text/css" class="cssStyles">
.rowcell
{
font-size: 15px !important;
}
</style>
</head>
<body>
<div class="content-container-fluid">
<div class="row">
<div class="cols-sample-area">
<script type="text/x-jsrender" id="columnTemplate">
<img style="width: 75px; height: 70px" src="../content/images/grid/Employees/{{:EmployeeID}}.png" alt="{{: EmployeeID }}" />
</script>
<div id="Grid"></div>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$("#Grid").ejGrid({
// the datasource "window.employeeView" is referred from jsondata.min.js
dataSource: ej.DataManager(window.employeeView).executeLocal(ej.Query().take(8)),
allowPaging: true,
pageSettings: { pageSize: 4 },
columns: [
{ headerText: "Employee Image", template: "#columnTemplate", textAlign: "center", width: 110 },
{ field: "EmployeeID", headerText: "Employee ID", isPrimarykey: true, editType: ej.Grid.EditingType.NumericEdit, textAlign: ej.TextAlign.Right, width: 90 },
{ field: "FirstName", headerText: "First Name", width: 90 },
{ field: "LastName", headerText: "Last Name", width: 90 },
{ field: "BirthDate", headerText: "Birth Date", width: 90, format: "{0:MM/dd/yyyy}", textAlign: ej.TextAlign.Right },
{ field: "Country", headerText: "Country", width: 80 }
]
});
});
</script>
</body>
</html>