How to implement Dojo autocomplete similar to jQuery UI autocomplete?

◇◆丶佛笑我妖孽 提交于 2019-12-01 01:50:23

问题


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


回答1:


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

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



来源:https://stackoverflow.com/questions/13551790/how-to-implement-dojo-autocomplete-similar-to-jquery-ui-autocomplete

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!