且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jQuery UI自动完成刷新数据

更新时间: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.