如何实现类似于 jQuery UI 自动完成的 Dojo 自动完成? [英] How to implement Dojo autocomplete similar to jQuery UI autocomplete?
问题描述
您好,我使用 JSP 和 jQuery UI 成功实现了文本输入的自动完成.自动完成数据从数据库中检索并通过服务器端的q"参数过滤.它返回包含查询字符串的所有项目:
SELECT name FROM organization WHERE name LIKE '%q%';
有没有办法对 Dojo 做同样的事情?我遵循了这个 Dojo 教程 ,但是当我输入示例字母 a
输入文本 文本输入中的文本被第一个建议替换 Ibam
而我的第一个字母 a
被替换为 I
来自词 Ibam
.它的工作原理很奇怪.请指教.
Vojtech
我会推荐 dijit/form/ComboBox
与 dojo/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屋!