RESOLVED - Combo in DHTMLXGrid

Hello,

I’m trying to use comobox into dhtmlxgrid, but i got some problems.

First, i would like to create a grid which is empty in beginning, and make a function to create rows dynamicaly.

My grid has this form : ed|date|hour|combo

function creerLignesDuplication(nbCreation) { tableau.clearAll(); var combo = tableau.getCombo(3); combo.clear(); for(var j = 0; j<tabComboType.length;j++) { combo.put(tabComboType[j][0],tabComboType[j][2]); } combo.save(); for(var i = 1; i<=nbCreation; i++) { tableauDuplication.addRow(i,"HERE_I_WANT_SOME_DEFAULT_VALUES[code]",tableauDuplication.getRowsNum());
}

}[/code]

Question : How to create several lines like this in javascript :question:

I’ll answer to my proper question :

  1. Accessing to the combo by grid.getColumnCombo(id)
  2. Add option to the combo by addOption(key,value) method
  3. Usind addRow method with an existing value for the combo

==>

function creerLignesDuplication(nbCreation) { tableauDuplication.clearAll(); var combo = tableauDuplication.getColumnCombo(1); combo.clearAll(); for(var j = 0; j<tabComboTypeTrsp.length;j++) { combo.addOption(tabComboTypeTrsp[j][0],tabComboTypeTrsp[j][2]); } for(var i = 1; i<=nbCreation; i++) { tableauDuplication.addRow(i,"val1|val2|...",tableauDuplication.getRowsNum()); } }