停止jQuery的自动完成过滤/搜索结果并填充整个源阵列数据 [英] Stop jQuery autocomplete to filter/search results and populate the entire source array data

查看:133
本文介绍了停止jQuery的自动完成过滤/搜索结果并填充整个源阵列数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:

我使用 jQuery的自动完成输入类型的文本。

I am using jQuery autocomplete for input type text.

我不希望过滤/搜索根据输入的结果,并希望以显示所有源阵列值建议。任何想法如何实现这一目标?

I do not want to filter/search the results based on input and want to display all the source array values as suggestions. Any idea how to achieve this?

有没有一种方法/替代只是填充整个数组数据源,不建议搜索或flltering?

Is there a a method/alternative to just populate an entire array data source as suggestions without searching or flltering?

技术说明:


  • 实际上,我在我的输入使用的onkeyup / preSS事件[文]这就要求一个ajax。在阿贾克斯成功的自动完成就会被调用。

  • 的jQuery v1.10.2的

  • 查询UI v1.11.3

code样品:<​​/ STRONG>

Code sample:

var pr_suggst= new Array();

for(var i=0; i< scnt; i++)
    pr_suggst[i]= {value:availableTags[i]['name'], idx:availableTags[i]['id']};

$("#text_inp_id").autocomplete({source: pr_suggst});

谢谢你。

推荐答案

尽量不过滤内容,这样才使request.term为空

try to not filter the contents, so that just make the request.term as empty

source: function( request, response ) {

      response( $.ui.autocomplete.filter(
      availableTags, "" ) ); // here
    },

小提琴

这篇关于停止jQuery的自动完成过滤/搜索结果并填充整个源阵列数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆