嗨,我正在使用 jquery ui 自动完成组合框插件,我最初是在document.ready
jQuery('#combolist_city').combobox();
我在页面加载时设置了一些选项
<select id="combolist_city" class="city" name="search[city]">
<option value="0">Select city</option>
<?php
if(isset($city_list))
{
foreach($city_list as $city_data)
{
if(isset($selected_city) && ($selected_city == $city_data['CityID']))
{
echo "<option selected='selecetd' value=".$city_data['CityID'].">".$city_data['CityName']."</option>";
}
else
{
echo "<option value=".$city_data['CityID'].">".$city_data['CityName']."</option>";
}
}
}
?>
</select>
现在我想改变他的选择,我想通过
jQuery("#combolist_city").combobox({
initialValues: ['aaa','bbb','ccc']
});
但它不起作用,它没有重新创建选项,
我该怎么做,请帮助.................................