88 строки
3.6 KiB
HTML
88 строки
3.6 KiB
HTML
<!DOCTYPE html>
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<head>
|
|
<title>Essential JS 1 : TreeGrid/Batch Editing</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 type="text/javascript" src="../scripts/jquery-1.11.3.min.js" ></script>
|
|
<![endif]-->
|
|
<!--[if gte IE 9]><!-->
|
|
<script src="../scripts/jquery-3.2.1.min.js" type="text/javascript"> </script>
|
|
<!--<![endif]-->
|
|
<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>
|
|
<script src="../scripts/jsontreegriddata.js"></script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
<div class="content-container-fluid">
|
|
<div class="row">
|
|
<div class="cols-sample-area">
|
|
<div id="TreeGridContainer" style="width:100%"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(function () {
|
|
var dateFormat = "{0:" + ej.preferredCulture()["calendars"]["standard"]["patterns"]["d"] + "}";
|
|
$("#TreeGridContainer").ejTreeGrid({
|
|
dataSource: batchEditData,
|
|
childMapping: "subtasks",
|
|
treeColumnIndex: 1,
|
|
rowHeight: window.theme == "material" ? 48 : window.theme == "office-365" ? 36 : 30,
|
|
isResponsive: true,
|
|
allowPaging: true,
|
|
allowSorting: true,
|
|
pageSettings: {
|
|
pageSize: 2,
|
|
pageSizeMode: ej.TreeGrid.PageSizeMode.Root
|
|
},
|
|
editSettings: {
|
|
allowAdding: true,
|
|
allowEditing: true,
|
|
allowDeleting: true,
|
|
editMode: "batchEditing",
|
|
batchEditSettings: { editMode: "cell" },
|
|
beginEditAction: "click",
|
|
rowPosition: "child"
|
|
},
|
|
columns: [
|
|
{ field: "taskID", headerText: "Id", editType: "numericedit", width: window.theme == "material" ? 90 : 45 },
|
|
{ field: "taskName", headerText: "Task Name", editType: "stringedit" },
|
|
{ field: "startDate", headerText: "Start Date", editType: "datepicker", format: dateFormat },
|
|
{ field: "endDate", headerText: "End Date", editType: "datepicker", format: dateFormat },
|
|
{ field: "duration", headerText: "Duration", editType: "numericedit" },
|
|
{ field: "progress", headerText: "Progress", editType: "numericedit" }
|
|
],
|
|
load: function () {
|
|
if (window.theme == "material")
|
|
this.treeIndentLevelWidth = 16;
|
|
},
|
|
toolbarSettings: {
|
|
showToolbar: true,
|
|
toolbarItems: [ej.TreeGrid.ToolbarItems.Add,
|
|
ej.TreeGrid.ToolbarItems.Delete,
|
|
ej.TreeGrid.ToolbarItems.Update,
|
|
ej.TreeGrid.ToolbarItems.Cancel,
|
|
ej.TreeGrid.ToolbarItems.Search
|
|
]
|
|
}
|
|
})
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|