javascript-ej1-demos/gantt/keyboardInteraction.html

156 строки
6.1 KiB
HTML

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 1 : Gantt</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<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.4.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/jsonganttdata.js"></script>
</head>
<body>
<div class="content-container-fluid">
<div class="row">
<div class="cols-sample-area">
<div id="GanttContainer" style="height:450px;width:100%;"></div>
</div>
<div id="sampleProperties">
<div class="prop-grid">
<div class="row">
<div class="col-md-3 colwidth">
<b>Keys</b>
</div>
<div class="col-md-3 colwidth">
<b>Description</b>
</div>
<div class="col-md-3 colwidth">
<b>Alt + j </b>
</div>
<div class="col-md-3 colwidth">
Focus
</div>
</div>
<div class="row">
<div class="col-md-3 colwidth">
<b>Home</b>
</div>
<div class="col-md-3 colwidth">
<p>First Row Selection</p>
</div>
<div class="col-md-3 colwidth">
<b>End</b>
</div>
<div class="col-md-3 colwidth">
Last Row Selection
</div>
</div>
<div class="row">
<div class="col-md-3 colwidth">
<b>F2</b>
</div>
<div class="col-md-3 colwidth">
Cell Edit
</div>
<div class="col-md-3 colwidth">
<b>Enter</b>
</div>
<div class="col-md-3 colwidth">
Save request
</div>
<div class="col-md-3 colwidth">
<b>Delete</b>
</div>
<div class="col-md-3 colwidth">
Delete Row
</div>
</div>
<div class="row">
<div class="col-md-3 colwidth">
<b>Ctrl + Down Arrow</b>
</div>
<div class="col-md-3 colwidth">
Expand All
</div>
<div class="col-md-3 colwidth">
<b>Ctrl + Up Arrow</b>
</div>
<div class="col-md-3 colwidth">
Collapse All
</div>
</div>
<div class="row">
<div class="col-md-3 colwidth">
<b>Left Arrow</b>
</div>
<div class="col-md-3 colwidth">
Collapse the Selected Row
</div>
</div>
<div class="row">
<div class="col-md-3 colwidth">
<b>Right Arrow</b>
</div>
<div class="col-md-3 colwidth">
Expand the Selected Row
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$("#GanttContainer").ejGantt({
dataSource: defaultGanttData,
allowSelection: true,
allowColumnResize: true,
taskIdMapping: "TaskID",
taskNameMapping: "TaskName",
scheduleStartDate: "02/23/2017",
scheduleEndDate: "03/30/2017",
startDateMapping: "StartDate",
endDateMapping: "EndDate",
progressMapping: "Progress",
childMapping: "Children",
treeColumnIndex: 1,
rowHeight: window.theme == "material" ? 48 : window.theme == "office-365" ? 36 : 30,
isResponsive: true,
editSettings: {
allowEditing: true,
allowAdding: true,
allowDeleting: true,
editMode: "cellEditing"
},
load: function () {
this.getColumns()[0].width = window.theme == "material" ? 60 : 30;
}
});
$("#sampleProperties").ejPropertiesPanel();
//Control focus key
$(document).on("keydown", function (e) {
if (e.altKey && e.keyCode === 74) { // j- key code.
$("#GanttContainer").find("#ejTreeGridGanttContainer").focus();
}
});
});
</script>
</body>
</html>