Hello,
Should I be using ‘co’ or ‘combo’ as the excell type for a combobox in a grid?
Also, how can I get the value not the label for a combobox in a grid? I am using grid.cells(rowId, cellInd).getValue() but it does not give the true value, but instead the label.
Thanks,
Martin
To implement combobox in the grid you can use “co”, “coro” or “combo” eXcell types. “combo” eXcell type is a integrated dhtmlxCombo, this eXcell type is availibe in PRO version only.
Please see more information about implementin combobox in the grid here dhtmlx.com/docs/products/dht … d_intcombo
To get label from the “combo” cell you can use method grid.cells(rowId, cellInd).getText()
Thank you for the reply.
I have the enterprise edition (2.0 I think) but when I try excell type ‘combo’ I get the error “Incorrect cell type: combo”.
You answered how to get the label, but I need the value. I am defining the options for the combo in XML as per the documentation, and am doing bar, but I get ‘bar’ not ‘foo’ using getValue(). How come?
Thanks,
Martin
This person also says getValue() returns the label not the value: dhtmlx.com/docs/products/kb/ … 20getvalue
That bug is from mid-2007, do you know if it has been fixed please?
I have the enterprise edition (2.0 I think) but when I try excell type ‘combo’ I get the error “Incorrect cell type: combo”.
To use that cell type you should include files:
�excells/dhtmlxgrid_excell_combo.js� from the dhtmlxGrid pagckage
�codebase/dhtmlxcombo.js�, �codebase/dhtmlxcombo.css� from the dhtmlxCombo package
>>Also, how can I get the value not the label for a combobox in a grid? I am using grid.cells(rowId, cellInd).getValue() but it does not give the true value, but instead the label.
Unfortunately we cannot reproduce this issue locally. Please provide use sample where we this issue occurs.
I have the enterprise edition (2.0 I think) but when I try
excell type ‘combo’ I get the error “Incorrect cell type: combo”.
>>To use that cell type you should include files:
>>�excells/dhtmlxgrid_excell_combo.js� from the dhtmlxGrid pagckage
>>�codebase/dhtmlxcombo.js�, �codebase/dhtmlxcombo.css� from the dhtmlxCombo package
I am using the all-in-one javascript file. I assume this has everything I need? In which case, still doesn’t work
>> >>Also, how can I get the value not the label for a combobox in a
grid? I am using grid.cells(rowId, cellInd).getValue() but it does not
give the true value, but instead the label.
>>Unfortunately we cannot reproduce this issue locally. Please provide use sample where we this issue occurs.
The link in my previous post shows someone with the same issue. Both getTitle() and getValue() return the label not the value.
I will try and re-produce and get back to you.
I am using the all-in-one javascript file. I assume this has everything I need? In which case, still doesn’t work
Do you use dhtmlxSuite version of all-in-one file? If not, you should compile new file including dhtmlxCombo package.
>>The link in my previous post shows someone with the same issue. Both getTitle() and getValue() return the label not the value.
Please send us example or xml sourse which you are using.
I have tried to re-produce the problem but it works as expected in the simple example I have created.
I don’t think it is a bug in my code and I am using the same methods and includes in the simple example and my non-working version.
I will try and deduce further.
Just noticed your reply, please see last post too
>> >>I am using the all-in-one javascript file. I assume this has everything I need? In which case, still doesn’t work
>>Do you use dhtmlxSuite version of all-in-one file? If not, you should compile new file including dhtmlxCombo package.
Yes I am using the dhtmlxSuite version bundled with the Enterprise download.
>> >>The
link in my previous post shows someone with the same issue. Both
getTitle() and getValue() return the label not the value.
>>Please send us example or xml sourse which you are using.
I have just tested the XML source with another, simpler example and it works as expected. I suspect the issue is in my javascript, or the way in which I am using dhtmlx components togethers. I have a dhtmlxWindow -> dhtmlxLayout -> dhtmlxGrid -> dhtmlxCombo.
Please check previous posts, I’ve posted 2-3 replies since your last
I have created a window and am attaching a layout to it, and adding a grid, using the following code:
// attach layout
ajaxExt_NumMapLayout = ajaxExt_NumMapWindow.attachLayout(‘3E’, ‘dhx_blue’);
// cell a
ajaxExt_NumMapLayout.cells(‘a’).hideHeader();
ajaxExt_NumMapLayout.cells(‘a’).setHeight(70);
var url=‘ajaxExt_NumMapWindow.php?cell=a’;
ajaxExt_NumMapLayout.cells(‘a’).attachURL(url);
// cell b
ajaxExt_NumMapLayout.cells(‘b’).hideHeader();
ajaxExt_NumMapGrid = ajaxExt_NumMapLayout.cells(‘b’).attachGrid();
ajaxExt_NumMapGrid.setImagePath(’/3rdparty/dhtmlx/imgs/’);
ajaxExt_NumMapGrid.enableMultiselect(false);
ajaxExt_NumMapGrid.setSkin(‘light’);
ajaxExt_NumMapGrid.preventIECaching(true);
ajaxExt_NumMapGrid.init();
var url=‘ajaxExt_NumMapWindow.php?cell=b’;
ajaxExt_NumMapGrid.loadXML(url);
// cell c
ajaxExt_NumMapLayout.cells(‘c’).hideHeader();
ajaxExt_NumMapLayout.cells(‘c’).setHeight(20);
var url=‘ajaxExt_NumMapWindow.php?cell=c’;
ajaxExt_NumMapLayout.cells(‘c’).attachURL(url);
As you can see I am attaching the grid to cell b. This code gives the label if I do getValue().
And here I have created a simple example using the same XML source, but this one works:
myGrid = new dhtmlXGridObject(‘myGridContainer’);
myGrid.setImagePath(’/3rdparty/dhtmlx/imgs/’);
myGrid.enableMultiselect(false);
myGrid.setSkin(‘light’);
myGrid.preventIECaching(true);
myGrid.init();
var url=‘ajaxExt_NumMapWindow.php?cell=b’;
myGrid.loadXML(url);
As you can see, they’re almost the same, and use the same XML source, but this one works (getValue() gives the proper value)…?
Yes I am using the dhtmlxSuite version bundled with the Enterprise download.
Which version of dhtmlxSuite do you use?
>>As you can see I am attaching the grid to cell b. This code gives the label if I do getValue().
We tested that code and issue doesnt appear. When you are calling getValue() method? Could you please provide us working and not working samples? Also please send us sample of xml which you are using
Yes I am using the dhtmlxSuite version bundled with the Enterprise download.
>Which version of dhtmlxSuite do you use?
The download was named dhtmlxSuite_2008Rel3_pro_81009.zip.
>>As you can see I am attaching the grid to cell b. This code gives the label if I do getValue().
>We
tested that code and issue doesnt appear. When you are calling
getValue() method? Could you please provide us working and not working
samples? Also please send us sample of xml which you are using
I will have to put together a non-working example I am able to send across. I will do this now and email you shortly
Thank you.
I have found the cause of the bug and have a working example, what email shall I send to please?
The bug is due to setting column types to read-only. After running setColTypes() the grid no longer returns the correct values.
Sent.
Ahaa, thanks.
I will use the disabled method instead, perfect.
Thank you for your help!