Thread jQuery UI: autocomplete - Suche von links nach rechts (3 answers)
Opened by MartinR at 2011-09-16 11:37

GwenDragon
 2011-09-16 21:07
#152506 #152506
User since
2005-01-17
14533 Artikel
Admin1
[Homepage]
user image
Ich habe das mal überflogen und bin zudem Ergebnis gekommen, dass die Option source maßgeblich ist.
Quote
The third variation, the callback, provides the most flexibility, and can be used to connect any data source to Autocomplete. The callback gets two arguments:
A request object, with a single property called "term", which refers to the value currently in the text input. For example, when the user entered "new yo" in a city field, the Autocomplete term will equal "new yo".
A response callback, which expects a single argument to contain the data to suggest to the user. This data should be filtered based on the provided term, and can be in any of the formats described above for simple local data (String-Array or Object-Array with label/value/both properties). It's important when providing a custom source callback to handle errors during the request. You must always call the response callback even if you encounter an error. This ensures that the widget always has the correct state.
Quelle: http://jqueryui.com/demos/autocomplete/

Du brauchst einen Callback, der request.term (das ist das eingegebene) mittels Regex mit den vorgegebenen Daten vergleicht und in response dann nur das zurück liefert, wenn was am Anfang matcht.

Schau mal in http://jqueryui.com/demos/autocomplete/#multiple
Last edited: 2011-09-16 21:10:08 +0200 (CEST)
die Drachin, Gwendolyn


Unterschiedliche Perl-Versionen auf Windows (fast wie perlbrew) • Meine Perl-Artikel

View full thread jQuery UI: autocomplete - Suche von links nach rechts