mirror of
https://github.com/hanzoai/jube-fork.git
synced 2026-11-02 14:29:36 +00:00
103 lines
2.9 KiB
HTML
Executable File
103 lines
2.9 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Shared DataSource</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="box wide">
|
|
<div class="box-col">
|
|
<input id="titles" />
|
|
<button class="k-button" id="remove">Remove Item</button>
|
|
</div>
|
|
</div>
|
|
<div class="demo-section k-content wide">
|
|
<div id="timeline"></div>
|
|
</div>
|
|
<script>
|
|
$(document).ready(function () {
|
|
var dataSource = new kendo.data.DataSource({
|
|
pageSize: 10,
|
|
transport: {
|
|
read: {
|
|
url: "../content/web/timeline/events-vertical-part1.json",
|
|
dataType: "json"
|
|
}
|
|
},
|
|
schema: {
|
|
model: {
|
|
id: "title",
|
|
fields: {
|
|
date: {
|
|
type: "date"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
dataSource.read();
|
|
|
|
$("#titles").kendoDropDownList({
|
|
autoBind: false,
|
|
optionLabel: "Select an item...",
|
|
dataSource: dataSource,
|
|
dataTextField: "title",
|
|
dataValueField: "title",
|
|
value: "Barcelona & Tenerife"
|
|
});
|
|
|
|
$("#timeline").kendoTimeline({
|
|
autoBind: false,
|
|
dataSource: dataSource,
|
|
alternatingMode: true,
|
|
collapsibleEvents: true,
|
|
orientation: "vertical"
|
|
});
|
|
|
|
$("#remove").click(function() {
|
|
var ddl = $("#titles").getKendoDropDownList();
|
|
var selectedItem = ddl.value();
|
|
var dataItems = $.grep(dataSource.data(), function(item){
|
|
return item.title == selectedItem;
|
|
});
|
|
|
|
if (dataItems.length) {
|
|
dataSource.remove(dataItems[0]);
|
|
}
|
|
|
|
ddl.value("");
|
|
});
|
|
});
|
|
</script>
|
|
</div>
|
|
|
|
<style>
|
|
.demo-section, .box {
|
|
max-width: 1200px;
|
|
}
|
|
</style>
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|