PDA

View Full Version : typeAhead acting odd, ASP.Net's fault?



ferr
23 Oct 2007, 6:36 AM
I have a combo box set up using a remote data store, when I attempt to use the typeAhead feature, it for some reason jumps to the first entry in the combo box rather than what I am typing. If I, for example, begin to type "California" as soon as I get to the 4th character (which I believe is the delayed trigger for typeAhead) it replaces my "Cali" text with the first entry, say Alabama. But I want it to replace it with California!

Here's the combo box code:


new Ext.form.ComboBox({
store: dsCombo,
displayField: 'library',
fieldLabel: 'Library',
typeAhead: true,
name: 'lib',
triggerAction: 'all',
emptyText:'Select a library...',
selectOnFocus:true,
width: 225
})

It's inside of an Ext.form.Form. I've done it without a Form and had the same results.

Is there a conflict in config parameters? Could it be an ASP.Net issue? I've only tested it in FireFox so far, also. Maybe there's just something else to setting up typeAhead with remote data?

zachext
23 Oct 2007, 9:09 AM
I have also run into this issue. I have tried using both an array datastore and an xml datastore remotely using aspx and classic asp pages with both FF 2 and IE 6.

My result is the same. No matter what is typed, the first item in list is the only one that will select. Other items can still be clicked for selection.

Here is a link to my thread: http://extjs.com/forum/showthread.php?t=15877

Any help would be great.

Thanks,
Zach

ferr
24 Oct 2007, 6:15 AM
No ideas for solving this issue?
Can anyone say if they have typeAhead working correctly when using ASP?

RSidetrack
24 Oct 2007, 7:44 AM
Have you checked to make sure what is being typed is transmitted to your ASP script? For example, if you type 'Cali', by default a post submission will be sent to your script with the variable name "query" and the value "Cali".

From this point you need to take "Cali" and do a query against the database for anything that starts with "Cali" and return that data set.

Make sense? I guess the question is have you done it using anything other than ASP such as ColdFusion or PHP?

theMike
25 Oct 2007, 12:16 PM
RSidetrack is right. If you want to populate the combobox in remote mode, your server side function has to accept the 'query' POST and return the filtered list. Although, to make it faster, you might use the combobox in local mode. So set up your store (from JSON, XML, whatever), then load it (i.e. ds.load()). Then put mode='local' and triggerAction='all' in your combobox. It will then take care of the filtering for you and it won't have to go to the server every time they type or click the down arrow. This is really only viable if the combobox list won't change after it's been rendered.

Hope this helps.