You are not logged in.
In the last video, I discussed ZendX_JQuery integration. Now we're going to take it a step further by developing our own jQuery autocomplete control, using a country list, PHP 5.3 and anonymous functions.
Offline
Hey Jon,
First I want to thank you for the good work, nice videos and stuff.
I've tried the video based with some extras like db connection and form controller, but i have an issue ginving extraParams.
I want people to select a user and return the ID value and not the name of this user.
Did you experience this already?
thx,
Xavier
Offline
Hi Xavier,
In order to get this sort of thing to work, you'll have to probably pass back more than just a list of usernames. I'm not sure how much flexibility the autocomplete control has in this regard, but you would want to send back a small json structure for each result.
e.g.
[{"user" : "Jon" , "id" : 23}, {"user": "Xavier" , "id" :24}, ...]
once you have it in this format coming from the server, you could then parse it on the client so that the username is all that shows up and you could store the id either in the DOM or in a variable on the page.
Hope that helps,
-
Jon
Offline
hi,
I tried an tried, but nothing seems to work out ...
JQuery wants something like :["User1","User2","User3"]
Someone already figured outs a problem like this?
I want to replace a dropdown, but it needs to do the trick offcourse ...
Offline
Dump your code snippet...
Offline
Hey,
found a prefect solution for me.
Instead of pretending the combobox, overwrite him ...
found the code here and i works like a charm!
http://jqueryui.com/demos/autocomplete/#combobox
thx for the feedback guys
Offline
Thanks for sharing Xavier ![]()
Offline
Hi,
first: thx for this great tutorial.
I tried to extend this autocomplete form with typical usages, similar to Xaviars needs.
These functionalities are nearly in every autocomplete search form of my applications:
1. Search over multiple tables and columns to get the nessessary data.
2. Return more than one Information out of one column to identify the selection data. (e.g. if you search a name, display the firstname, name and zip code)
3. Add some action if we focus a entry
4. Add some action if we select a entry (fill hidden fields or do some more ajax requests)
I am trying to get this work with zendx since five days. Sure with nearly 3 days of googling ![]()
You can follow my steps, thoughts an results in this thread:
http://www.zfforums.com/zend-framework- … -5510.html
I hope we can find a nice solution together, because I think this is the most wanted functionality of autocomplete or extended search fields.
Thx for helping. May be this is a stuff for the next tutorial ![]()
Offline