A group of item getting in to a combo



  var SQLString;

                  SQLString = "DBConnector.ashx?strSQL=Select CONTENT_DESC FROM LST_FIELD_OPTIONS WHERE TABLE_NAME = 'PARAMETER_DEF' AND FIELD_NAME = 'TABLE_TYPE' AND IS_FIELD_HEADER = 0 ";

                  var result_grid = page_layout.cells("b").attachGrid();
                  result_grid.setHeader("Table Type");
                  result_grid.init();
               
                  result_grid.loadXML(SQLString);


 formData = [

         {
             type: "label",
             list: [

                 {
                     type: "combo",
                     label: "Table Type :",
                     name: "in_table_type",
                     
                     labelWidth: 150,
                     inputWidth: 150,
                      options: [{
                            text : ??????????
                               }],

I setup a combo into a form.

A group of item is come from a database connector.

And the item is also load in a grid.

I want to put the group of item getting into the combo.

How about this method ?

Hello
We need to identify: do you mean something like:
dhtmlx.com/docs/products/dht … _grid.html
To take the column “Model” and to load all the models as combo items?

Darya,

Yes, I want to make a column “Model” items to a combo box options.

How about the method ?

Thx !

Ivan

Hello
You need to use gid’s method forEachRow() to iterate the rows.
Then get values from required column by getValue() method.
Make an array with new combo values.
And using combo’s method addOption() add all new option as in the last sample here:
dhtmlx.com/docs/products/dht … _init.html

Darya,

I mean get a grid column into a combo option.

I don’t get your mean. Can you give more explaination ?

And how about the below code ?


combo = grid.cells(id,index).getCellCombo();

combo = grid.getColumnCombo(column_index);

Thx !

You confused me.
If you want (as we’ve alreay discussed) to add the hole column as a combo options - use the approach i’ve posted:

dhxLayout = new dhtmlXLayoutObject("parentId", "2U"); dhxLayout.cells("a").setWidth(450); dhxGrid = dhxLayout.cells("a").attachGrid(); dhxGrid.setImagePath("../dhtmlxGrid/codebase/imgs/"); window.dhx_globalImgPath = "../dhtmlxCombo/codebase/imgs/"; combo = new dhtmlXCombo("comboDiv", "alfa1", 200); dhxLayout.cells("b").attachObject(document.getElementById("comboDiv")); dhxGrid.loadXML("../___xml/grid.xml", function(){ var arr = [], value; dhxGrid.forEachRow(function(id){ value = dhxGrid.cells(id,0).getValue(); arr.push([id,value]); }); combo.addOption(arr); });
(based on this sample: dhtmlx.com/docs/products/dht … _grid.html)
If you wan something elase, please, retry to explain.

These methods you discribed are’t approach for this purpose. They add combo objects in a grid, and not the reverse.