Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在jQuery自动完成和刷新列表中添加控件_Jquery_Jquery Ui_Jquery Plugins_Autocomplete - Fatal编程技术网

在jQuery自动完成和刷新列表中添加控件

在jQuery自动完成和刷新列表中添加控件,jquery,jquery-ui,jquery-plugins,autocomplete,Jquery,Jquery Ui,Jquery Plugins,Autocomplete,我正在显示列表项在jQuery自动完成结果中为每个项选择的次数的排名信息。现在,我想在自动完成中为每个项目添加一个控件,单击它会降低排名,也会刷新自动完成列表 代码: if (item.Value != null && item.Value != "" && item.Value != "0") { return $("<li></li>") .data

我正在显示列表项在jQuery自动完成结果中为每个项选择的次数的排名信息。现在,我想在自动完成中为每个项目添加一个控件,单击它会降低排名,也会刷新自动完成列表

代码:

if (item.Value != null && item.Value != "" && item.Value != "0") {
                    return $("<li></li>")
                        .data("item.autocomplete", item)
                        .append("<a style='color:Blue;'>" + item.label + "<span id='ancClearRanking' style='float:right;z-index:1000;' class='clearranking'>X</span><span id='spn`enter code here`Ranking' style='color:Green;font-size:10px;float:right;'>(" + item.Value + ")</span>" + "</a>")
                             .appendTo(ul);
                } 
 $(document).delegate("ul .clearranking", "click", function (e) {
                    var isConfirmed = confirm("Are you sure you want to delete?");
                    if (isConfirmed) {
                        $(inputcontrol).autocomplete("search");
                    }
                });
我面临两个问题

1单击清除排名时,首先调用选择函数。我想限制这一点

2触发$inputcontrol.autocompletesearch未触发


请提供帮助。

请提供复制此文件所需的其余代码。我已经创建了一个模拟案例