更新时间:2022-12-01 22:39:46
When you update the color, you need to also update the source that autocomplete uses, like this:
function addColor() {
//add colors
$('#empf').autocomplete("option", { source: colors });
}
此处是一个演示示例,添加颜色并一次更新自动填充源第二.
Here's a sample demo doing this, adding a color and updating the autocomplete source once a second.