/
global.R
50 lines (48 loc) · 978 Bytes
/
global.R
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
library(shiny)
library(jsTreeR)
customMenu <- JS("function customMenu(node)
{
var tree = $('#mytree').jstree(true);
var items = {
'rename' : {
'label' : 'Rename',
'action' : function (obj) { tree.edit(node); },
'icon': 'glyphicon glyphicon-edit'
},
'delete' : {
'label' : 'Delete',
'action' : function (obj) { tree.delete_node(node); },
'icon' : 'glyphicon glyphicon-trash'
},
'create' : {
'label' : 'Create',
'action' : function (obj) { tree.create_node(node); },
'icon': 'glyphicon glyphicon-plus'
}
}
return items;
}")
nodes <- list(
list(
text = "RootA",
children = list(
list(
text = "ChildA1"
),
list(
text = "ChildA2"
)
)
),
list(
text = "RootB",
children = list(
list(
text = "ChildB1"
),
list(
text = "ChildB2"
)
)
)
)