質問編集履歴
4
追記記入
test
CHANGED
File without changes
|
test
CHANGED
@@ -304,11 +304,95 @@
|
|
304
304
|
|
305
305
|
```
|
306
306
|
|
307
|
-
|
307
|
+
コンソールのエラーメッセージ
|
308
|
+
|
308
|
-
|
309
|
+
```ここに言語を入力
|
310
|
+
|
309
|
-
|
311
|
+
sample.html:51 Uncaught TypeError: Cannot read property 'appendChild' of null
|
312
|
+
|
310
|
-
|
313
|
+
at Calendar.eventRender (sample.html:51)
|
314
|
+
|
311
|
-
|
315
|
+
at Calendar.publiclyTrigger (main.js:6981)
|
316
|
+
|
317
|
+
at main.js:2399
|
318
|
+
|
319
|
+
at Array.filter (<anonymous>)
|
320
|
+
|
321
|
+
at filterSegsViaEls (main.js:2398)
|
322
|
+
|
323
|
+
at TimelineLaneEventRenderer.FgEventRenderer.renderSegEls (main.js:7820)
|
324
|
+
|
325
|
+
at TimelineLaneEventRenderer.FgEventRenderer.renderSegs (main.js:7774)
|
326
|
+
|
327
|
+
at TimelineLane.res [as renderFgEvents] (main.js:3249)
|
328
|
+
|
329
|
+
at TimelineLane.render (main.js:1793)
|
330
|
+
|
331
|
+
at TimelineLane.Component.receiveProps (main.js:3957)
|
332
|
+
|
333
|
+
eventRender @ sample.html:51
|
334
|
+
|
335
|
+
Calendar.publiclyTrigger @ main.js:6981
|
336
|
+
|
337
|
+
(anonymous) @ main.js:2399
|
338
|
+
|
339
|
+
filterSegsViaEls @ main.js:2398
|
340
|
+
|
341
|
+
FgEventRenderer.renderSegEls @ main.js:7820
|
342
|
+
|
343
|
+
FgEventRenderer.renderSegs @ main.js:7774
|
344
|
+
|
345
|
+
res @ main.js:3249
|
346
|
+
|
347
|
+
TimelineLane.render @ main.js:1793
|
348
|
+
|
349
|
+
Component.receiveProps @ main.js:3957
|
350
|
+
|
351
|
+
ResourceRow.render @ main.js:320
|
352
|
+
|
353
|
+
Component.receiveProps @ main.js:3957
|
354
|
+
|
355
|
+
ResourceTimelineView.updateRowProps @ main.js:779
|
356
|
+
|
357
|
+
ResourceTimelineView.render @ main.js:591
|
358
|
+
|
359
|
+
Component.receiveProps @ main.js:3957
|
360
|
+
|
361
|
+
CalendarComponent.renderView @ main.js:6304
|
362
|
+
|
363
|
+
CalendarComponent.render @ main.js:6168
|
364
|
+
|
365
|
+
Component.receiveProps @ main.js:3957
|
366
|
+
|
367
|
+
Calendar.renderComponent @ main.js:6831
|
368
|
+
|
369
|
+
Calendar.executeRender @ main.js:6805
|
370
|
+
|
371
|
+
Calendar.render @ main.js:6631
|
372
|
+
|
373
|
+
(anonymous) @ sample.html:56
|
374
|
+
|
375
|
+
```
|
376
|
+
|
377
|
+
最初のエラーの、
|
378
|
+
|
379
|
+
```ここに言語を入力
|
380
|
+
|
381
|
+
51 Uncaught TypeError: Cannot read property 'appendChild' of null
|
382
|
+
|
383
|
+
at Calendar.eventRender (sample.html:51)
|
384
|
+
|
385
|
+
```
|
386
|
+
|
387
|
+
51行目のコードは、
|
388
|
+
|
389
|
+
```ここに言語を入力
|
390
|
+
|
391
|
+
elem.querySelector('.fc-content').appendChild(img);
|
392
|
+
|
393
|
+
```
|
394
|
+
|
395
|
+
となっています。
|
312
396
|
|
313
397
|
### 補足情報(FW/ツールのバージョンなど)
|
314
398
|
|
3
内容編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -230,7 +230,7 @@
|
|
230
230
|
|
231
231
|
title: 'event 1',
|
232
232
|
|
233
|
-
imageurl:
|
233
|
+
imageurl: '../static/logo.png',
|
234
234
|
|
235
235
|
},
|
236
236
|
|
2
追記記入
test
CHANGED
File without changes
|
test
CHANGED
@@ -136,6 +136,174 @@
|
|
136
136
|
|
137
137
|
```
|
138
138
|
|
139
|
+
### 追記①(最初の回答をいただいてからのテストコード)
|
140
|
+
|
141
|
+
まずは、回答いただいた内容で画像が表示されるか、テストでコードを加えましたが、うまく動作しません。
|
142
|
+
|
143
|
+
```ここに言語を入力
|
144
|
+
|
145
|
+
<div id='calendar'></div>
|
146
|
+
|
147
|
+
```
|
148
|
+
|
149
|
+
のコードが全て表示されなくなってしまいます。
|
150
|
+
|
151
|
+
```HTML
|
152
|
+
|
153
|
+
<!DOCTYPE html>
|
154
|
+
|
155
|
+
<html>
|
156
|
+
|
157
|
+
<head>
|
158
|
+
|
159
|
+
<meta charset='utf-8'/>
|
160
|
+
|
161
|
+
<link href='../packages/core/main.css' rel='stylesheet'/>
|
162
|
+
|
163
|
+
<link href='../packages-premium/timeline/main.css' rel='stylesheet'/>
|
164
|
+
|
165
|
+
<link href='../packages-premium/resource-timeline/main.css' rel='stylesheet'/>
|
166
|
+
|
167
|
+
<script src='../packages/core/main.js'></script>
|
168
|
+
|
169
|
+
<script src='../packages-premium/timeline/main.js'></script>
|
170
|
+
|
171
|
+
<script src='../packages-premium/resource-common/main.js'></script>
|
172
|
+
|
173
|
+
<script src='../packages-premium/resource-timeline/main.js'></script>
|
174
|
+
|
175
|
+
<script>
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
document.addEventListener('DOMContentLoaded', function () {
|
180
|
+
|
181
|
+
var calendarEl = document.getElementById('calendar');
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
var calendar = new FullCalendar.Calendar(calendarEl, {
|
186
|
+
|
187
|
+
plugins: ['interaction', 'resourceTimeline'],
|
188
|
+
|
189
|
+
now: '2020-02-07',
|
190
|
+
|
191
|
+
aspectRatio: 1.8,
|
192
|
+
|
193
|
+
scrollTime: '00:00',
|
194
|
+
|
195
|
+
header: {
|
196
|
+
|
197
|
+
left: 'today prev,next',
|
198
|
+
|
199
|
+
center: 'title',
|
200
|
+
|
201
|
+
right: 'resourceTimelineMonth,resourceTimelineYear'
|
202
|
+
|
203
|
+
},
|
204
|
+
|
205
|
+
defaultView: 'resourceTimelineMonth',
|
206
|
+
|
207
|
+
resourceLabelText: 'Rooms',
|
208
|
+
|
209
|
+
resources: [
|
210
|
+
|
211
|
+
{id: 'a', title: 'room A'}, // ①ここで表示される'room A'の左側に画像を表示させたい
|
212
|
+
|
213
|
+
{id: 'b', title: 'room B'}, // ②ここで表示される'room B'の左側に画像を表示させたい
|
214
|
+
|
215
|
+
{id: 'c', title: 'room C'}, // ③ここで表示される'room C'の左側に画像を表示させたい
|
216
|
+
|
217
|
+
],
|
218
|
+
|
219
|
+
events: [
|
220
|
+
|
221
|
+
{
|
222
|
+
|
223
|
+
id: '1',
|
224
|
+
|
225
|
+
resourceId: 'a',
|
226
|
+
|
227
|
+
start: '2020-02-07T02:00:00',
|
228
|
+
|
229
|
+
end: '2020-02-07T07:00:00',
|
230
|
+
|
231
|
+
title: 'event 1',
|
232
|
+
|
233
|
+
imageurl: "../static/logo.png",
|
234
|
+
|
235
|
+
},
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
],
|
240
|
+
|
241
|
+
eventRender: function (info) {
|
242
|
+
|
243
|
+
// 画像のデータを持っていれば、画像を生成してテキストの後ろに追加
|
244
|
+
|
245
|
+
if (info.event.extendedProps.imageurl) {
|
246
|
+
|
247
|
+
let elem = info.el,
|
248
|
+
|
249
|
+
img = document.createElement('img');
|
250
|
+
|
251
|
+
img.src = info.event.extendedProps.imageurl;
|
252
|
+
|
253
|
+
elem.querySelector('.fc-content').appendChild(img);
|
254
|
+
|
255
|
+
}
|
256
|
+
|
257
|
+
},
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
});
|
262
|
+
|
263
|
+
calendar.render();
|
264
|
+
|
265
|
+
});
|
266
|
+
|
267
|
+
</script>
|
268
|
+
|
269
|
+
<style>
|
270
|
+
|
271
|
+
body {
|
272
|
+
|
273
|
+
margin: 0;
|
274
|
+
|
275
|
+
padding: 0;
|
276
|
+
|
277
|
+
font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
|
278
|
+
|
279
|
+
font-size: 14px;
|
280
|
+
|
281
|
+
}
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
#calendar {
|
286
|
+
|
287
|
+
max-width: 900px;
|
288
|
+
|
289
|
+
margin: 50px auto;
|
290
|
+
|
291
|
+
}
|
292
|
+
|
293
|
+
</style>
|
294
|
+
|
295
|
+
</head>
|
296
|
+
|
297
|
+
<body>
|
298
|
+
|
299
|
+
<div id='calendar'></div>
|
300
|
+
|
301
|
+
</body>
|
302
|
+
|
303
|
+
</html>
|
304
|
+
|
305
|
+
```
|
306
|
+
|
139
307
|
|
140
308
|
|
141
309
|
|
1
内容編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
-
ご教授いただ
|
15
|
+
ご教授いただけないでしょうか?
|
16
16
|
|
17
17
|
![イメージ説明](05618c5c8a4715d2a6377ee50c2b33c2.png)
|
18
18
|
|