2014년 12월 23일 화요일

FullCalender 샘플

/** 상세 내용은 링크 따라 가세요**/

원본 출처 : http://fullcalendar.io/
다운로드 : http://fullcalendar.io/download/

Html에
<link rel='stylesheet' href='../lib/cupertino/jquery-ui.min.css' />
<link href='../fullcalendar.css' rel='stylesheet' />
<link href='../fullcalendar.print.css' rel='stylesheet' media='print' />
<script src='../lib/moment.min.js'></script>
<script src='../lib/jquery.min.js'></script>
<script src='../fullcalendar.min.js'></script>
<script src='../lang-all.js'></script>
되어 있어야함.

$('#calendar').fullCalendar({
     header : {
         left : 'prev,next today',
 center : 'title',
 right : 'month,agendaWeek,agendaDay'
     },
     defaultDate: '2014-11-12',
     lang: 'ko',
     buttonIcons: false, // show the prev/next text
     weekNumbers: true,
     editable: true,
     eventLimit: true, // allow "more" link when too many events
     events: [
{
title: 'All Day Event',
start: '2014-11-01'
},
{
title: 'Long Event',
start: '2014-11-07',
end: '2014-11-10'
},
{
id: 999,
title: 'Repeating Event',
start: '2014-11-09T16:00:00'
},
{
id: 999,
title: 'Repeating Event',
start: '2014-11-16T16:00:00'
},
{
title: 'Conference',
start: '2014-11-11',
end: '2014-11-13'
},
{
title: 'Meeting',
start: '2014-11-12T10:30:00',
end: '2014-11-12T12:30:00'
},
{
title: 'Lunch',
start: '2014-11-12T12:00:00'
},
{
title: 'Meeting',
start: '2014-11-12T14:30:00'
},
{
title: 'Happy Hour',
start: '2014-11-12T17:30:00'
},
{
title: 'Dinner',
start: '2014-11-12T20:00:00'
},
{
title: 'Birthday Party',
start: '2014-11-13T07:00:00'
},
{
title: 'Click for Google',
url: 'http://google.com/',
start: '2014-11-28'
}
]


});
 [Option] 
   - Header: Calender 상단 title 과 button 설정
         left, rigth, center 위치 지정
   - defaultDate : ISO8601 에 따른 현재일 설정 형식은"2014-12-24" 와 같음.
   - lang : 언어 설정 (영어:en, 한국어 : ko 등등)
   - buttonIcons : 기본 false, theme를 사용할려면 true, theme 사용
      시 themeButtonIcons 옵션 추가
   - weekNumbers : true일때 월(Month) 선택시 주차 표시, false 일경우 주차 표시 안함.
   - editable : true 일때 드래그 또는 사이즈 조정을 하도록함, false 일경우 드래그 또는 사이즈 조정을 하지 않음
[Property Value]
title : 월/주/일 텍스트
prev : 이전 버튼(월/주/일)
next : 다음 버튼(월/주/일)
today : 이전/다음으로 월/주/일 이동한 상태에서 현재 일자로 이동하는 버튼

























2013년 9월 11일 수요일

parameter로 넘어온 string변수가 null이면 공백없는 string값을 넘긴다.

public static String replaceNull(String value) {
if (value == null || value.equals("") || value.equals("null"))
return "";
else
return (value.trim());
}

2013년 6월 13일 목요일

이클립스 단축 키

대문자, 소문자 변환 단축키
 소문자 -> 대문자 변환
   Ctrl+Shift+x
 대문자 -> 소분자 변환
   Ctrl+Shift+y

2013년 6월 11일 화요일

부모창에서 자식창 함수 호출

parent.html

<html>
<head>
<script type="text/javascript">
var frmFunc = undefined;
function callfrmFunc(){
if(typeof frmFunc != 'undefined'){
frmFunc();
}else{
alert('자식창 함수 호출 실패!')
}
}
</script>
</head>
<body>
<iframe id="testIframe" src="child.html"></iframe>
<button onclick="callfrmFunc();">Access function</button>
</body>
</html>

child.html

<html>
<head>
<script type="text/javascript">
function childFunc(){
alert('자식창 함수 호출 성공!')
}

parent.frmFunc = childFunc;
</script>
</head>
<body>
부모창에서 자식창 함수 호출 테스트!
</body>
</html>

2013년 5월 22일 수요일

Jquery mousedown 이벤트




$("#test").mousedown(function(event){

 
   //마우스 버튼 Event
            //    1. event.which=1:마우스 왼쪽 눌렀을때
    //   2. event.which=2:마우스 휠 눌렀을때
    //   3. event.which=3:마우스 오른쪽 눌렀을때
 
   if(event.which == 1){
    //Source
   }else if (event.which == 2){
    //source
   }else if(event.which == 3){
               //Source
            }

});


2013년 5월 9일 목요일

jquery 자동완성(20130510)


[js]
jquery-ui-1.10.2.js
jquery-1.9.1.js
[css]
jquery-ui_1.10.2.css
[javascript]
jQuery(function($){
inputTextAutocomplete();
});

function inputTextAutocomplete(){
    /*
    *1. 자바 action 이경우 ../xxx.action 을 호출 함.
    *      var URL = "../xxxx.action";
    *2. json 형식의 파일이 있을경우 경로를 url 로 설정 함.
    *      var URL = "../xxxx.json";
    */

    $('#inputText).autocomplete({
         source: function (request, response) {
          var param = "&vo.inputtext="+ $('#inputText).val();
          $.ajax({
                 url: URL,
                 dataType: "json",
                 type: 'POST',
                 contentType:"application/x-www-form-urlencoded;charset=UTF-8",
                 data: param,
                 error: function(data){
                
                 },
                 success: function(data) {
                
      $(".ui-autocomplete").css("z-index", "9999");
      $(".ui-autocomplete").css("overflow", "auto");
      response($.map(data, function(item) {
                          return {
                           codevalue: item.codevalue,
                           codeindex: item.codeindex,                                              
                          };
               }));
           }
    });
   },
         minLength:0,/* focus 함수를 사용함으로 인해 minLength 값을 1 로 주어도됨.*/
         autoFocus: false,
         delay: 100,
         focus: function () {
             // prevent value inserted on focus 
             //자동완성 검색 키워를 입력하여 콤보박스 형태로 자동완성되었을때
             //Key Down, Key Up 으로 선택시 입력 Text 박스에 입력한
            //자동완성 키워드가 리셋되는 형상을 방지 하기위해 return false 함.
            //focus: function () 을 사용하지 않거나 사용하되 return true 를 하면
            // 입력 Text 박스에 입력한 자동완성 키워드가 리셋 됨.
             return false;
         },
         select: function(event, ui) {
   
          $('#inputTextHidden).val(ui.item.codeindex);
    
     
        //alert(event.button);
        if (event.keyCode == 13 || event.button == 0){  
          //키보드 이벤트 또는 마우스 이벤트가 발생하면 처리 되는 로직추가
           ...........................  
        }
     
      }
      })
      .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
//inputText인 TEXT 박스에 입력시 드롭다운 콤보 박스 형태로 보여주도록 Html 구성 
          return $( "<li>" )
         .data( "item.autocomplete", item )
         .append( "<a>" + "<strong>"+item.codevalue+"</strong>  "+item.compnm + "</a><span style='cursor: pointer; position:absolute; top:3px; right:4px;' onclick=eventFunction('"+item.codeindex+"')>X</span>" )
         .appendTo( ul );
  };
}
function eventFunction(codeindex){
    alert(codeindex);
}
[html]
<input id="inputText"  type="text"  >
<input id="inputTextHidden"  type="hidden"  >