custom selectbox in-grid

Hello,

I’m building a blank grid with the folling columns : Name, Age, City, Region.
At start, this grid won’t have any rows and the user would use a “add” button to add them.

I’d like the “Region” column to be a selectbox which options come from a simple sql squery.
This sql query returns xml formated data.

How can I do that ?

Thanks for your help.

You may try to use “combo” exCell. It allows to load options from server.
Here is the tutorial about the usage:
docs.dhtmlx.com/doku.php?id=dhtm … cell_combo
Here is the working example:
dhtmlx.com/docs/products/dht … combo.html

Hi Sematik and thank you for your help.
Some new questions, further to the links you gave me.

1°) Do I have to delete my previous grid settings ?
Initially, I had :

mygrid.setHeader(["#master_checkbox","Date","Amount","Type", "label"]); mygrid.setColTypes("ch,dhxCalendar,edn,coro,coro"); mygrid.setNumberFormat("0,000.00 €",2,","," "); mygrid.setColSorting(',str,str,str,str'); mygrid.setInitWidths("32,75,*,*"); mygrid.setColAlign("center, left, right, left"); etc...

Now, am I supposed to write columns settings like this ?
my 1st Col

2°) setting the column type is different from the one I used. How should I set the different Col types in my xml file ?
In the given example, the col Type is written “combo” whereas I used to write “co” or “coro”.
What about the other types like : ed, edn, txt, ch…
Do I have to write “text” for “txt” and put editable=“true” ?

3°) How can I re-use the “#master_checkbox” column type in my xml file ?

Thanks
Regards

1°) Do I have to delete my previous grid settings ?

If you have decided to init your grid from XML so you will have to remove the init and configuration of the grid from script.

2°) setting the column type is different from the one I used. How should I set the different Col types in my xml file ?

“combo” and “co”/“coro” are different types of the column.

“co” - it is a simple combobox.
“coro” - it is a simple select box.
“combo” - excell uses dhtmlXCombo as the editor and supports all modes of this component.

3°) How can I re-use the “#master_checkbox” column type in my xml file ?
In case of init from xml:
#master_checkbox