The combo takes care of the querying automatically. There is a property on it called minChars that defaults to 4. If you wanted to change the chars it queries at you would set that property. The combo reads that property and tells the store to do a request with the typed text. That specific example uses a jsonp proxy, so you would need to look in the Net tab in firebug to see it. This is all done behind the scenes, you don't have to do it yourself.

The code you listed is just a template. The records in the store will have fields defined such as topicId, Id, lastPost, author, and excerpt. The item template just wraps those in html for every record.

The combo takes care of the querying automatically. There is a property on it called minChars that defaults to 4. If you wanted to change the chars it queries at you would set that property. The combo reads that property and tells the store to do a request with the typed text. That specific example uses a jsonp proxy, so you would need to look in the Net tab in firebug to see it. This is all done behind the scenes, you don't have to do it yourself.

The code you listed is just a template. The records in the store will have fields defined such as topicId, Id, lastPost, author, and excerpt. The item template just wraps those in html for every record.

Thanks a lot
I have one more question
Is there a way to display images with search results ?

Yes, templates read arbitrary html. You could easily put an image in and even base that image on a value found in the record as is done with the other fields.

OK.. I followed the example. in my case I would like to retrieve the names after entering 4 letters. e.g: alic
It worked except that it returns all the names not just what contains alic ,
also, I got the result in firebug but not appears in combo box as a list
I am sure my problem is simple but still can't figure out how to fix it.

So in a combobox there is a property called valueField and one called displayField that you should set.

valueField is the field that is received when doing something like getValue()
displayField is the field that is displayed in the dropdown

As far as returning everything, the combo is sending a parameter to the backend named query. That contains what you typed in the combo. You would then query your database for that text. Generally, if the combo will not contain a large amount of data, I like to set the queryMode to local on the combo and just let Ext handle everything assuming the store is loaded.

So in a combobox there is a property called valueField and one called displayField that you should set.

valueField is the field that is received when doing something like getValue()
displayField is the field that is displayed in the dropdown

As far as returning everything, the combo is sending a parameter to the backend named query. That contains what you typed in the combo. You would then query your database for that text. Generally, if the combo will not contain a large amount of data, I like to set the queryMode to local on the combo and just let Ext handle everything assuming the store is loaded.

Then in my case I should set valueField and displayField both to 'name' right ?
Also since I will receive a large amount of data then I have to set queryMode: 'remote' and queryParam : 'name' too. right ?

How about my query in php script ? do I have to receive any parameter to compare with in the query ?

Then in my case I should set valueField and displayField both to 'name' right ?

Yes

Originally Posted by Oxii

Also since I will receive a large amount of data then I have to set queryMode: 'remote' and queryParam : 'name' too. right ?

queryMode defaults to remote, so you don't need to do that. queryParam doesn't have to match a field. It is simply the parameter name that gets sent to your server with the text you typed in.

Originally Posted by Oxii

How about my query in php script ? do I have to receive any parameter to compare with in the query ?

Yes the parameter you need to grab to compare comes in as the queryParam value. queryParam defaults to "query". You would use "like" in your sql as you did previously, just with the text the combo sent as the queryParam..

Thank you
Now if I type anything in the combo, the list showed up but with results not related to what I typed!
I am not sure where is the problem exactly.
Here is my query:$sql = "SELECT name FROM student_name WHERE name ILIKE '%$query%' ORDER BY name ASC";