问题描述
亲爱的,
我创建了一个JQuery UI Autocomplete,其中source是一个标签 - 值对数组。
i需要设置默认的选定项目。我找到了一种方法,使用所需的标签,
但如果我有 VALUE 而不是 LABEL ,我怎么能这样做?
使用标签字符串设置默认值的代码:
dear all,
i've created a JQuery UI Autocomplete in which the source is an array of label-value pairs.
i need to set the default selected item. i found a way to do that using the desired label,
but how can i do that if i have the VALUE instead of the LABEL?
code for setting default value using label string :
$("myAutoCom").autocomplete("search", "someLabel");
var menu = $("myAutoCom").autocomplete("widget");
$(menu[0].children[0]).click();
i有价值,而不是标签。如何根据值设置所选项?
提前感谢
i have the value,not the label. how can i set selected item depending on value?
thanks in advance
推荐答案
i有值,而不是标签。如何根据价值设置所选项目?
提前感谢
i have the value,not the label. how can i set selected item depending on value?
thanks in advance
这篇关于JQuery UI Autocomplete使用ID(值)而不是Label设置默认值VALUE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!