column type : set 'combo' combokey : array type (ex) var array = [code list, combo title]
var codeList = [{code : '111', name : '111'}, {code : '222', name : '222'}] var codeList2 = [{code : 'AAA', name : 'AAA'}, {code : 'BBB', name : 'BBB'}] var column = [ { id: "text1", name: "text1", type: "text" , readonly : false, width: "100", align: 'left' }, { id: "text2", name: "text2", type: "text" , readonly : false, width: "100", align: 'left' }, { id: "date1", name: "combo1", type: "combo" , combokey : [codeList , 'select'], readonly : false, width: "100", align: 'center' }, { id: "date2", name: "combo2", type: "combo" , combokey : [codeList2 , 'select'], readonly : false, width: "100", align: 'center' } ]; var option = {}; var count = column.length; var data = []; for (var rowIndex = 0; rowIndex < 9; rowIndex++) { var item = {}; for (var i = 0; i < count; i++) { var col = column[i]; if (col.type == 'combo') item[col.id] = ''; else item[col.id] = col.name + '-' + rowIndex.toString() + '-' + i.toString(); } data.push(item); } var grid1 = new WdtGrid('grid1'); grid1.create(column, option); grid1.setData(data);