-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
54 lines (47 loc) · 1.59 KB
/
test.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
51
52
53
54
<html>
<head>
<!-- Styles -->
<link rel="stylesheet" type="text/css" href="./build/font.css">
<link rel="stylesheet" type="text/css" href="./build/jviz.css">
<link rel="stylesheet" type="text/css" href="./build/simple-list.css">
<!-- JavaScript -->
<script type="text/javascript" src="./build/vendor/jquery.min.js"></script>
<script type="text/javascript" src="./build/jviz.js"></script>
<script type="text/javascript" src="./build/simple-list.js"></script>
</head>
<body class="jviz-body" style="padding:50px;">
<script type="text/javascript">
//Simple list element
var t = null;
//Document ready function
$(document).ready(function()
{
//Table options
var opt = { parent: 'test', id: 'myTable' };
//Data
opt.data =
[
{ title: 'Element 0', detail: 'This is the element 0 of the list' },
{ title: 'Element 1', detail: 'This is the element 1 of the list' },
{ title: 'Element 2', detail: 'This is the element 2 of the list' },
{ title: 'Element 3', detail: 'This is the element 3 of the list' }
];
//Buttons
opt.btn =
[
{ id: 'open', text: 'Open', color: 'blue' },
{ id: 'delete', text: 'Delete', color: 'red' }
];
//Initialize the table
t = new jviz.modules.simpleList(opt);
//Click event
t.on('click', function(el){ alert('Click: ' + el.title); });
//Add the button event
t.on('btn:open', function(el){ alert('Open: ' + el.title); });
//Add the delete button event
t.on('btn:delete', function(el){ alert('Delete: ' + el.title); });
});
</script>
<div id="test"></div>
</body>
</html>