Results 1 to 3 of 3

Thread: Combo box auto complete- Remote load

  1. #1
    Sencha User
    Join Date
    Jul 2009

    Default Combo box auto complete- Remote load


    Auto complete feature of combo box is not working for me. Here is my code for combo.

    var statusCombo = new Ext.form.ComboBox({
    typeAhead: true, triggerAction: 'all', lazyRender:true,
    store: new{
    id: 0, root:'StatusSearch',
    fields: [
    {name:'myValue', mapping:'myValue'},
    {name:'myMeaning', mapping:'myMeaning'}
    url :contextPath + "/qs?op=getStatus"
    valueField: 'myValue',
    displayField: 'myMeaning',
    fieldLabel :'Status',
    hiddenName: 'statusSearch',
    anchor :'95%'

    When I look at the drop down I get the list populated as Open, Closed, Pending. But When I start typing like 'Clos' I expect the combo to display the "Closed" value in list. But it doesnt. Could any one please let me know whats wrong with this code?

    When I start typing the letters, server request call is made and combo is populated and default first value in list is selected but not the value matching my inputted letters.

    Any help on this would be highly appreciated.

  2. #2
    Ext User
    Join Date
    Sep 2009
    i'm from the Internet


    Hi nityajs,

    I'm no expert here, but I'll share with you what I've found out since no one has replied yet and I am having the same problem.

    I always get the first entry in the list regardless of what I have typed. In Firebug I noticed a POST being sent on each keypress (triggerAction). For this you set the mode to local in your combo configuration (default is remote).

    hiddenName: 'statusSearch',  
    anchor :'95%',
    mode: 'local'
    If you set this, the combo will never do the POST for the data and the box remains empty. So load your store beforehand. I did remoteJsonStore.load(); but mine is defined separately. In your case I guess you could add .load at the end:

    url :contextPath + "/qs?op=getStatus"       
    valueField: 'myValue',
    You should see a single POST in Firebug and typeAhead should work, but this is only good if you have a small number of records (all records are stored locally in memory this way). My problem now is switching back to remote mode and use paging (pageSize) so that I don't read all the records at one go on each triggerAction. I will post this in a new thread if you want to keep an eye.

  3. #3


    The control will fire requests to the host with "query=" the partially-completed text. If no text, that parameter isn't there.

    Apparently you have to return the right starting-value. Yourself.

    (This is not authoritative information: this is what I've discovered by T&E.)

    My advice is: load the combo, handle it locally. If it's so big that this won't work, then it probably shouldn't be a combo.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts