87 строки
3.5 KiB
HTML
87 строки
3.5 KiB
HTML
|
<!DOCTYPE html>
|
|||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|||
|
<head>
|
|||
|
<title>Essential JS 1 : Kanban Column Constraints</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/jsonkanbandata.js"></script>
|
|||
|
<script src="../scripts/jsrender.min.js"></script>
|
|||
|
<script src="../scripts/jquery.validate.min.js"></script>
|
|||
|
<script src="../scripts/jquery.validate.unobtrusive.min.js"></script>
|
|||
|
<script src="../scripts/ej.web.all.min.js"></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="Kanban"></div>
|
|||
|
</div>
|
|||
|
<div id="sampleProperties">
|
|||
|
<div class="prop-kanban">
|
|||
|
<div class="row">
|
|||
|
<div class="col-md-3" style="width:100px;">
|
|||
|
Constraint Type
|
|||
|
</div>
|
|||
|
<div class="col-md-3">
|
|||
|
<select id="constraint" class="e-ddl">
|
|||
|
<option value="column">Column</option>
|
|||
|
<option value="swimlane">Swimlane</option>
|
|||
|
</select>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<script type="text/javascript">
|
|||
|
$(function() {
|
|||
|
var data = ej.DataManager(window.kanbanData).executeLocal(ej.Query().take(30));
|
|||
|
$("#Kanban").ejKanban(
|
|||
|
{
|
|||
|
dataSource: data,
|
|||
|
isResponsive:true,
|
|||
|
enableTotalCount: true,
|
|||
|
columns: [
|
|||
|
{ headerText: "Backlog", key: "Open"},
|
|||
|
{ headerText: "In Progress", key: "InProgress",constraints: { max: 2 }, },
|
|||
|
{ headerText: "Done", key: "Close"}
|
|||
|
],
|
|||
|
keyField: "Status",
|
|||
|
allowTitle: true,
|
|||
|
fields: {
|
|||
|
primaryKey: "Id",
|
|||
|
swimlaneKey: "Assignee",
|
|||
|
content: "Summary",
|
|||
|
imageUrl: "ImgUrl"
|
|||
|
},
|
|||
|
allowSelection: false
|
|||
|
});
|
|||
|
$("#constraint").ejDropDownList({ width: "120px", change: "onConstraintTypeChange",selectedItemIndex: 0});
|
|||
|
});
|
|||
|
$("#sampleProperties").ejPropertiesPanel();
|
|||
|
function onConstraintTypeChange(args) {
|
|||
|
var kanbanObj = $("#Kanban").data("ejKanban");
|
|||
|
var type = args.selectedValue;
|
|||
|
var cols = kanbanObj.model.columns;
|
|||
|
for (var i = 0; i < cols.length; i++) {
|
|||
|
if (!ej.isNullOrUndefined(cols[i].constraints))
|
|||
|
cols[i].constraints.type = type;
|
|||
|
}
|
|||
|
kanbanObj.refreshColumnConstraints();
|
|||
|
}
|
|||
|
</script>
|
|||
|
</body>
|
|||
|
</html>
|