mirror of
https://github.com/hanzoai/jube-fork.git
synced 2026-11-02 14:29:36 +00:00
147 lines
5.1 KiB
HTML
Executable File
147 lines
5.1 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>API</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">
|
|
<h4>API Functions</h4>
|
|
<ul class="options">
|
|
<li>
|
|
<button id="enable">Enable</button> <button id="disable">Disable</button>
|
|
</li>
|
|
<li>
|
|
<button id="readonly">Readonly</button>
|
|
</li>
|
|
<li>
|
|
<button id="open">Open</button> <button id="close">Close</button>
|
|
</li>
|
|
<li>
|
|
<button id="getValue">Get value</button> <button id="getText">Get text</button>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="box-col">
|
|
<h4>Selection</h4>
|
|
<ul class="options">
|
|
<li>
|
|
<input id="index" value="0" style="width: 40px; margin: 0;" /> <button id="select">Select by index</button>
|
|
</li>
|
|
<li>
|
|
<input id="value" value="1" style="width: 40px; margin: 0;" /> <button id="setValue">Select by value</button>
|
|
</li>
|
|
<li>
|
|
<input id="word" value="Pulp" style="width: 100px; margin: 0;" /> <button id="find">Select item starting with</button>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="demo-section k-content">
|
|
<h4>Select movie</h4>
|
|
<input id="movies" style="width: 100%;" />
|
|
</div>
|
|
|
|
<script>
|
|
$(document).ready(function () {
|
|
var data = [
|
|
{ text: "The Shawshank Redemption", value: "1" },
|
|
{ text: "The Godfather", value: "2" },
|
|
{ text: "The Godfather: Part II", value: "3" },
|
|
{ text: "Il buono, il brutto, il cattivo.", value: "4" },
|
|
{ text: "Pulp Fiction", value: "5" },
|
|
{ text: "12 Angry Men", value: "6" },
|
|
{ text: "Schindler's List", value: "7" },
|
|
{ text: "One Flew Over the Cuckoo's Nest", value: "8" },
|
|
{ text: "Inception", value: "9" },
|
|
{ text: "The Dark Knight", value: "10" }
|
|
];
|
|
$("#movies").kendoDropDownList({
|
|
dataTextField: "text",
|
|
dataValueField: "value",
|
|
dataSource: data,
|
|
height: 100
|
|
})
|
|
.closest(".k-widget")
|
|
.attr("id", "products_wrapper");
|
|
var dropdownlist = $("#movies").data("kendoDropDownList"),
|
|
setValue = function (e) {
|
|
if (e.type != "keypress" || kendo.keys.ENTER == e.keyCode)
|
|
dropdownlist.value($("#value").val());
|
|
},
|
|
setIndex = function (e) {
|
|
if (e.type != "keypress" || kendo.keys.ENTER == e.keyCode) {
|
|
var index = parseInt($("#index").val());
|
|
dropdownlist.select(index);
|
|
}
|
|
},
|
|
setSearch = function (e) {
|
|
if (e.type != "keypress" || kendo.keys.ENTER == e.keyCode)
|
|
dropdownlist.search($("#word").val());
|
|
};
|
|
$("#enable").click(function () {
|
|
dropdownlist.enable();
|
|
});
|
|
$("#disable").click(function () {
|
|
dropdownlist.enable(false);
|
|
});
|
|
$("#readonly").click(function () {
|
|
dropdownlist.readonly();
|
|
});
|
|
$("#open").click(function () {
|
|
dropdownlist.open();
|
|
});
|
|
$("#close").click(function () {
|
|
dropdownlist.close();
|
|
});
|
|
$("#getValue").click(function () {
|
|
alert(dropdownlist.value());
|
|
});
|
|
$("#getText").click(function () {
|
|
alert(dropdownlist.text());
|
|
});
|
|
$("#setValue").click(setValue);
|
|
$("#value").keypress(setValue);
|
|
$("#select").click(setIndex);
|
|
$("#index").keypress(setIndex);
|
|
$("#find").click(setSearch);
|
|
$("#word").keypress(setSearch);
|
|
});
|
|
</script>
|
|
<style>
|
|
.configuration .k-textbox {
|
|
width: 40px;
|
|
}
|
|
|
|
.k-button {
|
|
min-width: 80px;
|
|
}
|
|
</style>
|
|
</div>
|
|
|
|
|
|
</body>
|
|
</html>
|