i am using dropdown widget in dojo (dijit), i want to set the selected option the top menu
i tried this code:
dijit.byId('projectId').addOption({ label: item.projname , value: item.projid, selected:true });
here the selected: true
is not working
Thanks
The asker's code is not correct as the
selected
property applies for the construction of the object. As PaulR suggested, the asker should usedijit.byId('projectId').set("value",item.projid);
when the select widget has already been created.Aside: I would suggest using the AMD module
"dijit/registry"
rather than the rootdijit
object.