jquery selectMenu refresh doesn't work

好久不见. 提交于 2019-12-06 14:57:08

I believe you have to do it like this:

[... your other code...]
$('#ddlReportFarms').selectmenu({'refresh': true});

Thanks MilkyWayJoe

when I write it like you suggested, the selectMenu duplicates itself, just creates another selectmenu as many times as I run the refresh.. frustrating. this is the HTML after the refresh:

<a id="ddlReportFarms-button" class="ui-selectmenu ui-widget ui-state-default ui-corner-all ui-selectmenu-dropdown" aria-owns="ddlReportFarms-menu" aria-haspopup="true" href="#" role="button" style="width: 198px;">
<span class="ui-selectmenu-status">Select Farm</span>
<span class="ui-selectmenu-icon ui-icon ui-icon-triangle-1-s"></span>
</a>
<a id="ddlReportFarms-button" class="ui-selectmenu ui-widget ui-state-default ui-selectmenu-dropdown ui-corner-all" aria-owns="ddlReportFarms-menu" aria-haspopup="true" href="#" role="button" style="width: 198px;">
<span class="ui-selectmenu-status">Select Farm</span>
<span class="ui-selectmenu-icon ui-icon ui-icon-triangle-1-s"></span>
</a>

Which version of selectmenu do you use?

My fork has no method refresh but your proposal is correct (aka uing selectmenu() on a already initialized selectmenu to refresh it). Please see the wiki for more information: https://github.com/fnagel/jquery-ui/wiki/Selectmenu

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