質問編集履歴
4
編集しなおしました。PHP javascript htmlと分割しております。
title
CHANGED
File without changes
|
body
CHANGED
@@ -135,9 +135,10 @@
|
|
135
135
|
</body>
|
136
136
|
</html>
|
137
137
|
|
138
|
-
```
|
138
|
+
```
|
139
139
|
|
140
140
|
|
141
|
+
```javascript
|
141
142
|
$(function(){$('#tree1').jstree();});
|
142
143
|
|
143
144
|
$(function(){
|
@@ -148,6 +149,8 @@
|
|
148
149
|
alert(dept_id);
|
149
150
|
})
|
150
151
|
});
|
152
|
+
```
|
153
|
+
|
151
154
|
```HTML
|
152
155
|
<!DOCTYPE html>
|
153
156
|
<html>
|
3
分割しなおしました。度々申し訳ございません。
title
CHANGED
File without changes
|
body
CHANGED
@@ -135,8 +135,9 @@
|
|
135
135
|
</body>
|
136
136
|
</html>
|
137
137
|
|
138
|
-
```
|
138
|
+
```jQuery
|
139
139
|
|
140
|
+
|
140
141
|
$(function(){$('#tree1').jstree();});
|
141
142
|
|
142
143
|
$(function(){
|
2
ご指摘いただいたとおり「```」で分割しました。申し訳ございません。
title
CHANGED
File without changes
|
body
CHANGED
@@ -135,7 +135,7 @@
|
|
135
135
|
</body>
|
136
136
|
</html>
|
137
137
|
|
138
|
-
|
138
|
+
```jqery
|
139
139
|
|
140
140
|
$(function(){$('#tree1').jstree();});
|
141
141
|
|
@@ -147,7 +147,7 @@
|
|
147
147
|
alert(dept_id);
|
148
148
|
})
|
149
149
|
});
|
150
|
-
|
150
|
+
```HTML
|
151
151
|
<!DOCTYPE html>
|
152
152
|
<html>
|
153
153
|
<head>
|
1
jun68ykt様のご指摘どおり、ブラウザのソースを表示から取得したソースを追加しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -147,7 +147,38 @@
|
|
147
147
|
alert(dept_id);
|
148
148
|
})
|
149
149
|
});
|
150
|
+
-------実際のブラウザでの表示のソース------------------
|
151
|
+
<!DOCTYPE html>
|
152
|
+
<html>
|
153
|
+
<head>
|
154
|
+
<meta charset="UTF-8">
|
155
|
+
<title>階層データ</title>
|
156
|
+
<link rel="stylesheet" href="./jstree/style.min.css">
|
157
|
+
<script src="./jq/jquery-3.3.1.min.js"></script>
|
158
|
+
<script src="./jstree/jstree.min.js"></script>
|
159
|
+
<script src="./jq/testsq.js"></script>
|
150
160
|
|
161
|
+
</head>
|
162
|
+
<body>
|
163
|
+
<form>
|
164
|
+
<div id="tree1">
|
165
|
+
<ul>
|
166
|
+
<li id="1">親1</li>
|
167
|
+
<li id="2">親2<ul>
|
168
|
+
<li id="3">子2-1<ul>
|
169
|
+
<li id="11">孫3</li></ul></li></ul></li>
|
170
|
+
<li id="7">親7<ul>
|
171
|
+
<li id="4">子7-1<ul>
|
172
|
+
<li id="8">孫</li>
|
173
|
+
<li id="9" data-jstree='{"opened":true,"selected":true}'>孫2<ul>
|
174
|
+
<li id="10">ひ孫</li></ul></li></ul></li></ul></li></ul>
|
175
|
+
</div>
|
176
|
+
</form>
|
177
|
+
<br>
|
178
|
+
<br>
|
179
|
+
|
180
|
+
</body>
|
181
|
+
</html>
|
151
182
|
```
|
152
183
|
|
153
184
|
### 試したこと
|