Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Jun 22, 2009 09:18
open dhtmlx forum
dhtmlx Combo passing value need to be selected

hi,

i have a dropdown with year

value display
2006 06-07
2007 07-08
2008 08-09
2009 09-10 (selected by def. in XML initialization)
2010 10-11
2011 11-12
2012 12-13

from database i am getting 2007 ..which means i need to show 07-08 as selected value instead of 09-10 def. selected value. i try to find the index for 2007 and to set it as selected which is not working. can you share if you have any working example.

Answer posted by Alex (support) on Jun 23, 2009 01:10

Hello,

the sample is attached

Attachments (1)
Answer posted on Jun 23, 2009 03:08
thanks, but my question is through java script how set the value in combo (in my example i want to set 2012 as a selected value in combo)
Answer posted by Alex (support) on Jun 23, 2009 03:12

Hello,

actually the attached sample demonstrates that. Please, take a look at it once again:

 z.loadXML("data.xml",function(){
  z.selectOption(z.getIndexByValue("2007")) /*or just z.setComboValue("2007")*/
 });