var datagrid; var SBGridProperties = {}; function createGrid(){ SBGridProperties.parentid = 'SBGridArea'; SBGridProperties.id = 'datagrid'; SBGridProperties.jsonref = 'ct_data.resources'; SBGridProperties.rowheader = ['seq','update']; SBGridProperties.selectmode = 'free'; SBGridProperties.columns = [ {caption : ['기본정보','나이'], ref : 'age', width : '250px', style : 'text-align:center', type : 'input', isvalidatecheck: true, validate : 'fnValidate'}, {caption : ['기본정보','입사일'], ref : 'hiredate', width : '300px', style : 'text-align:center', type : 'textarea', isvalidatecheck: true, validate : function(objGrid, nRow, nCol, strValue) { if (strValue != "") { return strValue; } else { return { isValid : false, message : '값을 입력하시오.' }; } }, typeinfo : {locale : 'ko', dateformat :'yymmdd'} }, ]; datagrid = _SBGrid.create(SBGridProperties); }; function fnValidate(objGrid, nRow, nCol, strValue) { if (strValue === '') { return { isValid : false, message : '값을 입력하시오.'}; } if (!(/[0-9]/g).test(strValue)) { return { isValid : false, message : '숫자를 입력하시오.'}; } return Number(strValue); }