mirror of
https://github.com/hanzoai/jube-fork.git
synced 2026-11-02 14:29:36 +00:00
88 lines
3.5 KiB
HTML
Executable File
88 lines
3.5 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>MVVM</title>
|
|
<meta charset="utf-8">
|
|
<link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.common.min.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.default.min.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.default.mobile.min.css" rel="stylesheet">
|
|
<script src="../../js/jquery.min.js"></script>
|
|
<script src="../../js/jszip.min.js"></script>
|
|
<script src="../../js/kendo.all.min.js"></script>
|
|
<script src="../content/shared/js/console.js"></script>
|
|
<script>
|
|
|
|
</script>
|
|
|
|
|
|
</head>
|
|
<body>
|
|
|
|
<a class="offline-button" href="../index.html">Back</a>
|
|
|
|
<div id="example">
|
|
<div class="configurator">
|
|
<div class="header">Configurator</div>
|
|
<div class="box-col">
|
|
<div>
|
|
<label><input type="checkbox" data-bind="checked: isVisible">Visible</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div data-role="treelist"
|
|
data-selectable="true"
|
|
data-columns="[
|
|
{ 'field': 'Name' },
|
|
{ 'field': 'Position', 'width': 270 },
|
|
]"
|
|
data-bind="source: employees,
|
|
visible: isVisible,
|
|
events: {
|
|
change: onChange
|
|
}"
|
|
style="height: 300px"></div>
|
|
<script>
|
|
var viewModel = kendo.observable({
|
|
isVisible: true,
|
|
onChange: function (e) {
|
|
var widget = e.sender;
|
|
var dataItem = widget.dataItem(widget.select());
|
|
kendoConsole.log("event :: change(" + kendo.stringify(dataItem, null, 4) + ")");
|
|
},
|
|
employees: new kendo.data.TreeListDataSource({
|
|
data: [
|
|
{ EmployeeID: 1, ReportsTo: null, Name: "Andrew Fuller", Position: "CEO" },
|
|
{ EmployeeID: 2, ReportsTo: 1, Name: "Andrew Hopkins", Position: "Sales" },
|
|
{ EmployeeID: 3, ReportsTo: 1, Name: "Betty Stewart", Position: "Legal advisor" },
|
|
{ EmployeeID: 4, ReportsTo: 1, Name: "Jon Michaels", Position: "Product team lead" },
|
|
{ EmployeeID: 5, ReportsTo: 1, Name: "Rebecca Williams", Position: "Software developer" },
|
|
{ EmployeeID: 6, ReportsTo: 4, Name: "John Smith", Position: "Marketing associate" },
|
|
{ EmployeeID: 7, ReportsTo: 4, Name: "Natasha Andrews", Position: "System administrator" },
|
|
{ EmployeeID: 8, ReportsTo: 4, Name: "Victoria Belmont", Position: "Designer" },
|
|
{ EmployeeID: 9, ReportsTo: 4, Name: "Emma Watkins", Position: "Software developer" }
|
|
],
|
|
schema: {
|
|
model: {
|
|
id: "EmployeeID",
|
|
parentId: "ReportsTo",
|
|
fields: {
|
|
EmployeeId: { type: "number", editable: false, nullable: false },
|
|
ReportsTo: { nullable: true, type: "number" },
|
|
Name: { field: "Name", type: "string" },
|
|
Position: { field: "Position", type: "string" }
|
|
}
|
|
}
|
|
}
|
|
})
|
|
});
|
|
kendo.bind($("#example"), viewModel);
|
|
</script>
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|