Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement Dojo autocomplete similar to jQuery UI autocomplete?

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

like image 294
Vojtech Avatar asked Nov 25 '12 14:11

Vojtech


1 Answers

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

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

like image 122
phusick Avatar answered Nov 02 '22 00:11

phusick