Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by RamaRao R on Jan 10, 2010 23:14
open dhtmlx forum
How to create Combo Box in Grid cell/Column using code

Hello,

How to create Combo Box in Grid cell/Column using code and my data could be in JsArray or JSON. Please let me know yor thoughts.

Thanks,

RamaRao R.

Answer posted by Alex (support) on Jan 12, 2010 01:56

Hello,

in case of using "co" type the data combo is initialized as follows:

..

grid.init();

var combo = grid.getCombo(columnIndex);

combo.put(key1,value1);...

combo.put(keyN,valueN);

if you use "combo" type, it's possible to use addOption method of the dhtmlxCombo component to add options from js array:

grid.init();

var combo = grid.getColumnCombo(columnIndex);

combo.addOption([[key1,value1],...,[keyN,valueN]]);