Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by haritha on Oct 01, 2008 04:18
open dhtmlx forum
combo

Hi,

I had a combo in my grid. I used combo.put(key,value). value will be displayed on the grid but i need the key to save it in the database. so may i know how to get the key based on the value.

haritha

Answer posted by Support on Oct 01, 2008 05:15
Actually ,the combo in grid show values, but any data operaton will use key related to value. getValue, serialization, dataprocessor - all of them will work with keys, so, in common case, value to key translation will be done automatically. 

If by some reason you still need to obtain such data manually, you can use something similar to next

var combo = grid.getCombo(index)
var key = combo.keys[combo.values._dhx_find(value)];