Uncaught Error: no such method 'value' for selectmenu widget instance

[亡魂溺海] 提交于 2019-12-05 20:32:35
fnagel

Are you aware there are two versions?

https://github.com/fnagel/jquery-ui/ (old, fork of filament groups work) https://github.com/jquery/jquery-ui/tree/selectmenu (new, official)

The new one does not have value or index methods.

Since you are getting error, I reckon you are using new version.

So you should use $('select.widthOpts').selectedIndex=index; where index is a integer value that you already know the position of the required option in selectmenu

the below code also works fine. I am using jQuery 1.10.2 and jquery-ui 1.11.1

$('select.widthOpts').val(wDims.feet).selectmenu('refresh')
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!