Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Marc Stein on May 02, 2009 17:35
open dhtmlx forum
SelectBox

I am creating an empty grid with three columns. The columns types are defined by

mygrid.setColTypes("ed,ed,coro");

Then in response to user input I add rows via

mygrid.addRow(newId,"XXX,00116",mygrid.getRowsNum())

How can I set the coro column to be a list box with four values? Is this done when I initialize the grid or when the row is added? What is the syntax?

Many thanks
Answer posted by dhxSupport on May 04, 2009 02:13

How to manipulate with "coro" eXcell type please see more information here http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Selectbox_collections.html#grid_art_selectbox

Answer posted by Alex (support) on May 04, 2009 02:16

Hello, 

yes, you can change the colunm type after grid intialization. 

Try to use setCellExcellType method. For example:

function setType(id){
  mygrid.setCellExcellType(id,0,"coro");
})

...

mygrid.addRow(newId,"XXX,00116",mygrid.getRowsNum())

mygrid.forEachRow(setType);

var c = mygrid.getCombo(0);
c.put(key_1,text_1);
c.put(key_2,text_2);

...

Please, see http://dhtmlx.com/docs/products/dhtmlxGrid/doc/alpha.html for more details