I am using jQuery UI Selectmenu and am having trouble setting the value of a rendered selected. It seems to change the selected option in the underlying select, but the selectmenu does not show the change. I am calling .selectmenu('refresh', true) but nothing happens.
Here is an example: http://jsfiddle.net/sociobit/wYBeL/
Hiya So demo (Solution) http://jsfiddle.net/wYBeL/43/ instead of refresh try
.selectmenu("value", selectedValue);
OR (Hack) http://jsfiddle.net/wYBeL/36/ (keeps the selectpopup setting of yours :) What ever suits youSo I checked the DOM using firebug and it seems the selectmenu() style: popup adds extra layer of styling but the #sel2 value is set correctly and you just need to setup the right element with correct value. I reckon refresh will work when you will have an ajax populating a dropdown and refreshing part of page.
Hmm, you can try looking at API for more details and In case if you don't need selectmenu popup then without it this will work as well like @jiimw said: (BUt styling goes weird) : http://jsfiddle.net/wYBeL/35/ ;Please let me know if this doesn't help I will remove post.
extra link: http://wiki.jqueryui.com/w/page/12138056/Selectmenu
Hope both helps.
JQuery Code here
** OR **
Cheers