problem in setting the option dojox.form.DropDownSelect

View: New views
1 Messages — Rating Filter:   Alert me  

problem in setting the option dojox.form.DropDownSelect

by lukess :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

  i am using the dojox.form.DropDownSelect in my application and after doing some calculations, i just want to set one of the option in the the drop down to be selected by default.....

the way i am doing is

var dropDown = dijit.byId('testDrDo');
for(var i = 0 ; i < dropDown.options.length; i++)
        {
                if(dropDown.options[i].value == "xyz")
                {
       
                        dropDown.options[i].selected = true;
                        break;
                }

        }

 it comes into the loop and also reaches the point, but unfortunately it's not setting it........

I am stuck at this point, i also tried

dijit.byId('testDrDo').options[i].attr("selected", true);

but even that didn't work...

Regards,
Lokesh