Skip to content

New selectmenu implementation doesn't sync to the select element. #278

Closed
kfox1111 opened this Issue Nov 19, 2012 · 7 comments

2 participants

@kfox1111

When elements are changed in the select menu, the hidden select elements are unchanged. In this example, a callback to watch for changes does not get fired if .selectmenu() is called. If you comment out the line, the alert fires as expected. If you inspect the DOM, the hidden select element does not change.

http://efox.cc/temp/jquery.selectmenu.html

@fnagel
Owner
fnagel commented Nov 19, 2012

I'm sorry but I wasn't aware you're talking about the new official selectmenu widget. This GitHub accoun is for the older branch only. Please refer to the Selectmenu Wiki or the pull request next time:
jquery#492
http://wiki.jqueryui.com/w/page/12138056/Selectmenu

Regarding your question:
Selectmenu widget does not work that way you need to use the change callback.

$('#speed').selectmenu({
    change: function(){
        alert($('#speed').val());
    }
});
@fnagel
Owner
fnagel commented Dec 13, 2012

Any feedback on this issue?

@kfox1111

Sorry for the late reply.

I changed my code to use the change callback as suggested and things are working well. Thank you for the suggestion.

Not being able to simply use the native callback though is a bit confusing since other jquery ui widgets do use the underlying callback. Button for example. It may be a good feature to support in the future. More of a wish list item now though.

Thanks,
Kevin

@fnagel
Owner
fnagel commented Dec 14, 2012

Problem is that there is no crossbrowser way to use these callbacks. We would need to to do some kind of event polling which is quite performance hungry.

Please feel free to start a discussion about this at the Wiki page, I'm sure Jörn or Scott are able to explain it much better.

@fnagel
Owner
fnagel commented Jan 17, 2013

Any feedback on this issue?

@kfox1111

Not sure what more to say. It works well the way it is, other then requiring ever so slight code changes to the javascript using it. If it can't reasonably be done because of lack of web browser support, that's totally understandable. Hopefully some day if that changes, then the support can be added. I've been using it for the last two months on my site and its been working great.

Thanks,
Kevin

@fnagel
Owner
fnagel commented Jan 17, 2013

Ok, thanks for the feedback. I will close this issue for now.

@fnagel fnagel closed this Jan 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.