dhtmlXGridComboObject Get key value via js.

I have a dhtmlxGrid with a single column of type “co”. I have set the options to be:
var opts= {
1: “one_value”,
2: “two_value”

When I iterate over the grid in javascript to create a json object with all the data in it. I use this code:
vals = [];
val = {
i: id,
v: mygrid.cells(id,0).getValue(),

Except that the getValue is getting the value, when with a combo box I want the key. So I want the “1” not the “one_value”. Any ideas? Thanks!

The getValue() method returns the value of the cell.
you may try to use combo.get(value) to get the label of the option by it’s value.
Here is the tutorial:
docs.dhtmlx.com/doku.php?id=dhtm … n_from_xml

yea that never worked…I had to use the key and value array and do a manual lookup…