var datagrid; var SBGridProperties = {}; function createGrid(){ SBGridProperties.parentid = 'SBGridArea'; SBGridProperties.id = 'datagrid'; SBGridProperties.jsonref = 'datepickerData'; SBGridProperties.selectmode = 'free'; SBGridProperties.rowheader = ['seq', 'update']; SBGridProperties.columns = [ {caption : ['CalendarType: date'], ref : 'startday', width : '200px', style : 'text-align:center', type : 'datepicker', typeinfo : {dateformat :'yymmdd', mindate: "20170101", maxdate: "20191225", calendartype: "date"}, format : {type:'date', rule:'yyyy-mm-dd', origin : 'yyyymmdd' }}, {caption : ['CalendarType: year'], ref : 'startday1', width : '200px', style : 'text-align:center', type : 'datepicker', typeinfo : {mindate: "2019", maxdate: "2025", calendartype: "year"}, format : {type:'date', rule:'yyyy', origin : 'yyyy' }}, {caption : ['CalendarType: month'], ref : 'startday2', width : '200px', style : 'text-align:center', type : 'datepicker', typeinfo : {mindate: "01", maxdate: "11", calendartype: "month"}, format : {type:'date', rule:'mm', origin : 'mm' }}, {caption : ['CalendarType: yearmonth'], ref : 'startday3', width : '200px', style : 'text-align:center', type : 'datepicker', typeinfo : {mindate: "201701", maxdate: "201912", calendartype: "yearmonth"}, format : {type:'date', rule:'yyyy-mm', origin : 'yyyymm' }} ]; datagrid = _SBGrid.create(SBGridProperties); datagrid.bind('colchanged', 'setColStyle'); $('#textValue').text('최소날짜를 지정할 열 클릭 후, 캘린더타입에 맞는 형태로 최소날짜 입력 및 "setMinDate" 버튼을 클릭하여 열의 최소 날짜를 변경해보세요.'); $('#tValue').val(''); }; function setColStyle(){ var nCol = datagrid.getCol(); var prevCol = datagrid.getPrevCol(); datagrid.setColStyle(prevCol, "data", "background-color", "#FFFFFF"); datagrid.setColStyle(nCol, "data", "background-color", "#e3dde3"); }; function fnSetCellData(){ var nCol = datagrid.getCol(); var date = $("#tValue").val(); datagrid.setMinDate(nCol, date); }; function fnGetMinData(){ var dateCol = datagrid.getCol(); alert("지정 열의 최소 날짜 값 : " + datagrid.getMinDate(dateCol)); }