forked from BasicPrimitives/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCaseButtonsPanel.html
More file actions
84 lines (79 loc) · 2.44 KB
/
CaseButtonsPanel.html
File metadata and controls
84 lines (79 loc) · 2.44 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Custom buttons</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" type='text/css'>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.css" rel="stylesheet" type='text/css'>
<script type="text/javascript" src="../../primitives.js"></script>
<link href="../../css/primitives.css" media="screen" rel="stylesheet" type="text/css" />
<script type='text/javascript'>
var control;
document.addEventListener('DOMContentLoaded', function () {
var options = new primitives.OrgConfig();
var items = [
new primitives.OrgItemConfig({
id: 0,
parent: null,
title: "James Smith",
description: "VP, Public Sector",
image: "../images/photos/a.png"
}),
new primitives.OrgItemConfig({
id: 1,
parent: 0,
title: "Ted Lucas",
description: "VP, Human Resources",
image: "../images/photos/b.png"
}),
new primitives.OrgItemConfig({
id: 2,
parent: 0,
title: "Fritz Stuger",
description: "Business Solutions, US",
image: "../images/photos/c.png"
})
];
options.items = items;
options.cursorItem = 0;
options.hasButtons = primitives.Enabled.True;
options.hasSelectorCheckbox = primitives.Enabled.False;
options.buttonsPanelSize = 36;
options.onButtonsRender = function (data) {
var itemConfig = data.context;
var element = data.element;
element.innerHTML = "";
element.appendChild(primitives.JsonML.toHTML(["div",
{
class: "btn-group-vertical btn-group-sm"
},
["button",
{
"type": "button",
"data-buttonname": "delete",
"class": "btn btn-light"
},
["i", { "class": "fa fa-minus-circle" }]
],
["button",
{
"type": "button",
"data-buttonname": "add",
"class": "btn btn-light"
},
["i", { "class": "fa fa-user-plus" }]
]
]));
};
options.onButtonClick = function (e, data) {
var message = "User clicked '" + data.name + "' button for item '" + data.context.title + "'.";
alert(message);
};
control = primitives.OrgDiagram(document.getElementById('basicdiagram'), options);
});
</script>
</head>
<body>
<div id="basicdiagram" style="width: 640px; height: 480px; border-style: dotted; border-width: 1px;"></div>
</body>
</html>