forked from Simply007/kc-custom-element-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
50 lines (42 loc) · 1.45 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Date picker custom element</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="style.css">
<script src="js.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://app.kenticocloud.com/js-api/custom-element.js"></script>
</head>
<body>
<p>Re-run Date: <input type="text" id="datepicker" /></p>
<script>
$(function () {
var value = "10/12/2012";
function setDatePicker() {
$("#datepicker").datepicker({
onSelect: function (dateText, inst) {
CustomElement.setValue(dateText);
}
});
$("#datepicker").datepicker("setDate", value);
}
function updateDisabled(disabled) {
console.log(disabled);
$("#datepicker").datepicker("option", "disabled", disabled);
}
CustomElement.init((element, context) => {
value = element.value;
CustomElement.setHeight(300);
setDatePicker();
updateDisabled(element.disabled);
CustomElement.onDisabledChanged(updateDisabled);
});
});
</script>
</body>
</html>