var autocompleteData = [ "A-1", "A-2", "A-3", "A-4", "A-5", "B-1", "B-2", "B-3" ]; var autocompleteName = [ "박영배", "박영수", "박기홍", "박기주", "박주영", "박주미" ]; var datagrid; var SBGridProperties = {}; function createGrid(){ SBGridProperties.parentid = 'SBGridArea'; SBGridProperties.id = 'datagrid'; SBGridProperties.jsonref = 'ct_data.gridData2'; SBGridProperties.selectmode = 'free'; SBGridProperties.rowheader = ['seq', 'update']; SBGridProperties.columns = [ {caption : ['이름'], ref : 'name', width : '100px', style : 'text-align:center', type : 'inputbutton', typeinfo : {autocomplete : autocompleteName}, fixedstyle : 'background-color:yellow'}, {caption : ['나이'], ref : 'age', width : '100px', style : 'text-align:center', type : 'input' , typeinfo : {maxlength : 3, autonext : true}}, {caption : ['생년월일'], ref : 'birth', width : '100px', style : 'text-align:center', type : 'output'}, {caption : ['소속'], ref : 'team', width : '100px', style : 'text-align:center', type : 'input', typeinfo : {autocomplete : autocompleteData}, fixedstyle : 'background-color:yellow'}, {caption : ['입사년차'], ref : 'period', width : '80px', style : 'text-align:center', type : 'output'}, {caption : ['국적'], ref : 'nation', width : '100px', style : 'text-align:center', type : 'combo', typeinfo : {ref:'comboData', label:'label', value:'value' , itemcount : 4, displayui:true} }, {caption : ['도시'], ref : 'nation2', width : '100px', style : 'text-align:center', type : 'combo', typeinfo : {ref:'combofilteringData', label:'label', value:'value' , displayui : true, itemcount : 4, filtering: {usemode : true, uppercol : 5, attrname : 'code'}}}, {caption : ['결혼여부'], ref : 'married', width : '80px', style : 'text-align:center', type : 'checkbox', typeinfo : {checkedvalue : 'true'} }, {caption : ['입사일'], ref : 'hiredate', width : '120px', style : 'text-align:center', type : 'inputdate', typeinfo : {locale : 'ko'} }, {caption : ['팀장여부'], ref : 'leader', width : '80px', style : 'text-align:center', type : 'radio' } ]; datagrid = _SBGrid.create(SBGridProperties); }; function fnSetAutoComplete(){ var nCol = datagrid.getCol(); datagrid.setAutoComplete(nCol, JSON.parse($('#autoCompleteData').val()) ); };