如何实现类似于 jQuery UI 自动完成的 Dojo 自动完成? [英] How to implement Dojo autocomplete similar to jQuery UI autocomplete?

查看:23
本文介绍了如何实现类似于 jQuery UI 自动完成的 Dojo 自动完成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我使用 JSP 和 jQuery UI 成功实现了文本输入的自动完成.自动完成数据从数据库中检索并通过服务器端的q"参数过滤.它返回包含查询字符串的所有项目:

SELECT name FROM organization WHERE name LIKE '%q%';

有没有办法对 Dojo 做同样的事情?我遵循了这个 Dojo 教程 ,但是当我输入示例字母 a 输入文本 文本输入中的文本被第一个建议替换 Ibam 而我的第一个字母 a 被替换为 I 来自词 Ibam.它的工作原理很奇怪.请指教.

Vojtech

解决方案

我会推荐 dijit/form/ComboBoxdojo/store/JsonRest.

查看实际效果:http://jsfiddle.net/phusick/N8DqG/>

Good day, using JSP and jQuery UI I have successfuly implemented autocompletion for a text input. Autocomplete data are retrieved from a database and filtered by 'q' parameter on the server side. It returns all items containing queried string:

SELECT name FROM organization WHERE name LIKE '%q%';

Is there a way how to do the same with Dojo? I followed this Dojo tutorial , but when I type for example letter a into the text input the text in the text input get's replaced by first suggestion Ibam and my first letter a is replaced with I from word Ibam. It works strange. Please advise.

Vojtech

解决方案

I would recommend dijit/form/ComboBox with dojo/store/JsonRest.

See it in action: http://jsfiddle.net/phusick/N8DqG/

这篇关于如何实现类似于 jQuery UI 自动完成的 Dojo 自动完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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