質問編集履歴

1

ソースコードを整形しました

2019/02/03 02:46

投稿

apimaster2018
apimaster2018

スコア15

test CHANGED
File without changes
test CHANGED
@@ -12,9 +12,21 @@
12
12
 
13
13
  ### 該当のソースコード
14
14
 
15
+ ```ここに言語を入力
15
16
 
17
+ <html>
16
18
 
19
+ <head>
20
+
21
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
22
+
23
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.5/jstree.min.js"></script>
24
+
25
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.5/themes/default/style.min.css" />
26
+
27
+ <script>
28
+
17
- $(function(){
29
+ $(function(){
18
30
 
19
31
  var data1 = [{
20
32
 
@@ -38,6 +50,8 @@
38
50
 
39
51
  }];
40
52
 
53
+
54
+
41
55
  $('#Tree').jstree({
42
56
 
43
57
  core: {
@@ -50,11 +64,11 @@
50
64
 
51
65
  checkbox: {
52
66
 
53
- three_state : false,
67
+ three_state : false, // to avoid that fact that checking a node also check others
54
68
 
55
- whole_node : false,
69
+ whole_node : false, // to avoid checking the box just clicking the node
56
70
 
57
- tie_selection : false
71
+ tie_selection : false // for checking without selecting and selecting without checking
58
72
 
59
73
  },
60
74
 
@@ -69,6 +83,8 @@
69
83
  })
70
84
 
71
85
  .on("check_node.jstree uncheck_node.jstree", function(e, data) {
86
+
87
+ <!-- var parent_node = $("#Tree").jstree().get_node(data.node).parents; -->
72
88
 
73
89
  var parent_node = $("#Tree").jstree().get_node(data.node).children;
74
90
 
@@ -126,8 +142,24 @@
126
142
 
127
143
  return false;
128
144
 
129
- }
145
+ }
130
146
 
131
- } );
147
+ } );
132
148
 
133
149
  });
150
+
151
+ </script>
152
+
153
+ </head>
154
+
155
+ <body>
156
+
157
+ <div id="Tree">
158
+
159
+ </div>
160
+
161
+ </body>
162
+
163
+ </html>
164
+
165
+ ```