Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- calendar
- springflow
- JQuery
- 페치조인
- 자바서블릿
- JPQL
- 엔티티직접사용
- 프로젝트생성
- fetchjoin
- paging
- jQuery값전송
- values()
- 제네릭
- 대량쿼리
- 페이징
- jQuery값전달
- 스프링데이터흐름
- namedQuery
- joinfetch
- 제너릭
- fullcalendar
- jscalendar
- javaservlet
- javascriptcalendar
- jQueryUI
- Hibernate
- LIST
- 벌크연산
- JPA
- Generic
Archives
- Today
- Total
가자공부하러!
Javascript Full Calendar(1) - 적용 본문
1. 개발환경
1. 다운로드
> Javascript Full Calendar 홈페이지 : https://fullcalendar.io
> Javascript Full Calendar Scheduler : https://fullcalendar.io/docs/premium
2. 실습환경 : Spring Boot 2.1.7, JDK8, JSP, tiles, Full Calendar 4.3.1
3. 적용페이지 : src/main/webapp/WEB-INF/views/calendar/calmain.jsp
2. 적용방법
1. 프로젝트 폴더로 다운로드 받은 fullcalendar의 packages 폴더 import
> 경로 : src/main/resources/static/fullcalendar
2. view 작성
> css, script 파일 import
> 소스코드
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 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <link href='fullcalendar/core/main.css' rel='stylesheet' /> <link href='fullcalendar/daygrid/main.css' rel='stylesheet' /> <script src='fullcalendar/core/main.js'></script> <script src='fullcalendar/daygrid/main.js'></script> <script> document.addEventListener('DOMContentLoaded', function() { var calendarEl = document.getElementById('calendar'); var calendar = new FullCalendar.Calendar(calendarEl, { plugins: [ 'dayGrid' ] }); calendar.render(); }); </script> </head> <body> <div id='calendar'></div> </body> </html> | cs |
3. 끝!
3. 기능 활용 방법
1. 드래그 앤 드랍 일정관리 메뉴 생성
> 적용방법 : https://fullcalendar.io/docs/external-dragging
> 뷰 :
> 소스코드
- 1. JSP
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 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <link href='fullcalendar/core/main.css' rel='stylesheet' /> <link href='fullcalendar/daygrid/main.css' rel='stylesheet' /> <link href='fullcalendar/timegrid/main.min.css' rel='stylesheet' /> <script src='fullcalendar/core/main.js'></script> <script src='fullcalendar/daygrid/main.js'></script> <script src="fullcalendar/interaction/main.min.js"></script> <script src="fullcalendar/timegrid/main.min.js"></script></head> <body> <div id="external-events"> <p> <strong>Draggable Events</strong> </p> <div class="fc-event">My Event 1</div> <div class="fc-event">My Event 2</div> <div class="fc-event">My Event 3</div> <div class="fc-event">My Event 4</div> <div class="fc-event">My Event 5</div> <p> <input type="checkbox" id="drop-remove"> <label for="drop-remove">remove after drop</label> </p> </div> <div id='calendar'></div> </body> </html> | cs |
- 2. js
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 | document.addEventListener('DOMContentLoaded', function() { var Calendar = FullCalendar.Calendar; var Draggable = FullCalendarInteraction.Draggable; var containerEl = document.getElementById('external-events'); var calendarEl = document.getElementById('calendar'); var checkbox = document.getElementById('drop-remove'); // initialize the external events // ----------------------------------------------------------------- new Draggable(containerEl, { itemSelector: '.fc-event', eventData: function(eventEl) { return { title: eventEl.innerText }; } }); // initialize the calendar // ----------------------------------------------------------------- var calendar = new Calendar(calendarEl, { plugins: [ 'interaction', 'dayGrid', 'timeGrid' ], header: { left: 'prev,next today', center: 'title', right: 'dayGridMonth,timeGridWeek,timeGridDay' }, editable: true, droppable: true, // this allows things to be dropped onto the calendar drop: function(info) { // is the "remove after drop" checkbox checked? if (checkbox.checked) { // if so, remove the element from the "Draggable Events" list info.draggedEl.parentNode.removeChild(info.draggedEl); } } }); calendar.render(); }); | cs |
- 3. css
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 | html, body { margin: 0; padding: 0; font-family: Arial, Helvetica Neue, Helvetica, sans-serif; font-size: 14px; } #external-events { position: fixed; z-index: 2; top: 20px; left: 20px; width: 150px; padding: 0 10px; border: 1px solid #ccc; background: #eee; } .demo-topbar + #external-events { /* will get stripped out */ top: 60px; } #external-events .fc-event { margin: 1em 0; cursor: move; } #calendar-container { position: relative; z-index: 1; margin-left: 200px; } #calendar { max-width: 900px; margin: 20px auto; } | cs |
'공부 > Javascript, Node.js, jQuery, Ajax' 카테고리의 다른 글
Javascript Full Calendar(3) - DB 값 가져오기 (6) | 2019.09.03 |
---|---|
Javascript Full Calendar(2) - 한글설정, 클릭이벤트, 일정 추가 (2) | 2019.09.03 |
Javascript, jQuery 캘린더 만들기(수제) (2) | 2019.08.30 |
Javascript 생활코딩 강의 (0) | 2019.08.30 |
기초(3) - 선택자 정리(Javascript, jQuery) (0) | 2019.08.30 |
Comments