Categories | Question details Back To List | ||
How to read the option value of combo_v type cell in dhtmlxGrid
I am using dhtmlxGrid with one of the column cell types as combo_v. I am loding this grid through XML as below. <?xml version="1.0" encoding="UTF-8"?> <head> <row id="row1" > <cell type="combo_v" xmlcontent="1" style="border-style: inset;border-width:1px;">CLIENT SERVICE ASSOCIATE </row>
When I select some value from combo and then read it using method myGrid.cellById(rowId,1).getValue(); , it gives me the text that is currently deplayed on the drop down. e.g. CLIENT SERVICE ASSOCIATE, FINANCIAL ADVISOR or MARKETER How do I get/read the value of the selected option. e.g. CSA,FA, MAKTR
Answer posted by Alexandra on Feb 08, 2010 01:54 Hello, you should use a value of some option as cell value to select this option: <cell type="combo_v" xmlcontent="1" style="border-style: inset;border-width:1px;">CSA instead of <cell type="combo_v" xmlcontent="1" style="border-style: inset;border-width:1px;">CLIENT SERVICE ASSOCIATE Moreover if options are the same for all cell in the second column, it's better to define them in <column> tag: <?xml version="1.0" encoding="UTF-8"?> <head> <row id="row1"> <cell style="border-style: inset;border-width:1px;">CSA</cell> </row> PS: please ask questions on http://forum.dhtmlx.com/ or http://support.dhtmlx.com/ Answer posted on Feb 08, 2010 07:30 For my requirement, the option values and Cell values are different. Option values are the codes coming from and going back to database while cell values are just text that will be displayed on the screen. Is it possible to read option values? How? Answer posted by Stanislav (support) on Feb 09, 2010 02:03 Grid linked to the combo options by key-to-key links. So grid must contains codes, and it will show labels by mapping those codes to the options of combo. |