일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- namedQuery
- joinfetch
- jscalendar
- JPQL
- fullcalendar
- paging
- javaservlet
- fetchjoin
- springflow
- Generic
- 프로젝트생성
- calendar
- LIST
- 벌크연산
- JQuery
- Hibernate
- JPA
- jQuery값전달
- 대량쿼리
- 스프링데이터흐름
- 페치조인
- 제네릭
- 제너릭
- 페이징
- jQuery값전송
- 자바서블릿
- 엔티티직접사용
- javascriptcalendar
- jQueryUI
- values()
- Today
- Total
가자공부하러!
Javascript Full Calendar(2) - 한글설정, 클릭이벤트, 일정 추가 본문
Javascript Full Calendar(2) - 한글설정, 클릭이벤트, 일정 추가
오피스엑소더스 2019. 9. 3. 18:411. 개발환경
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. Full Calendar 한글표기 설정
1. 참고 : https://fullcalendar.io/docs/locale#loading-locales-with-script-tags-and-browser-globals
2. 요약
> 뷰에서 사용할 locale js파일 불러오기
- ex_) <script src='fullcalendar/core/locales/ko.js'></script>
> 캘린더 생성할 때 locale 옵션 주기
- ex_)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 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); } }, locale: 'ko' }); | cs |
3. Full Calendar cell 클릭 이벤트 추가
1 2 3 4 5 | var calendar = new Calendar(calendarEl, { dateClick: function() { alert('a day has been clicked!'); } }); | cs |
1 2 3 | calendar.on('dateClick', function(info) { console.log('clicked on ' + info.dateStr); }); | cs |
2. 종류
> dateClick : 날짜 셀을 클릭할 때 발생하는 이벤트
> eventClick : 일정을 클릭할 때 발생하는 이벤트
- 예) 일정을 클릭했을 때, 해당 일정의 정보를 콘솔에 출력하는 함수
4. Full Calendar 새 일정 추가
> Getter
- Array calendar.getEvents()
- getEvents() 메소드를 통해 calendar 객체가 갖고있는 이벤트를 모두 배열 타입으로 가져올 수 있다.
- 예) var arrCal = calendar.getEvents(); alert(arrCal[0].title);
- 예) $.each( arrCal, function(index, item){ console.log(arrCal[index1].title); });
'공부 > Javascript, Node.js, jQuery, Ajax' 카테고리의 다른 글
정규식 활용 회원가입 기능(아이디 중복확인, 요소 입력확인) - JavaScript, jQuery (0) | 2019.09.09 |
---|---|
Javascript Full Calendar(3) - DB 값 가져오기 (6) | 2019.09.03 |
Javascript Full Calendar(1) - 적용 (4) | 2019.08.31 |
Javascript, jQuery 캘린더 만들기(수제) (2) | 2019.08.30 |
Javascript 생활코딩 강의 (0) | 2019.08.30 |