Results 1 to 2 of 2

Thread: Combo box Ajax

  1. #1
    Ext JS Premium Member
    Join Date
    Apr 2009
    Posts
    116
    Vote Rating
    1
      0  

    Default Combo box Ajax

    I have a grid, where I use a combo box as a cell editor. I populate this combo box, by sending an AJAX request to the server on keyup listener. On keyup if the length of the value typed in the combo box is 3, im sending an AJAX request. But the problem is, if the user types in the value fast, this keyup event fails to send an AJAX request. I am using Ext 3.1 version.


    var cityStore = new Ext.data.JsonStore({
    fields: ['value']

    });

    editor: new Ext.form.ComboBox({
    id : 'Origin City',
    store: cityStore,
    //minChars: 3,
    //triggerAction: 'query',
    mode : 'local',
    displayField:'value',
    valueField :'value',
    hideTrigger: true,
    //forceSelection: true,
    typeAhead: true,
    emptyText :'Select Value',
    enableKeyEvents: true,
    listeners: {
    keyup: function(){
    var value=this.getEl().dom.value;
    if(value.length==3){
    Ext.Ajax.request({
    url: '/ActionServlet',
    timeout: 300000,
    params: {
    Action: 'fetchCellValues',
    field:id,
    SearchText:value,
    frmDate:frmDate,
    toDate:toDate
    },
    success: function(response) {
    var obj = Ext.decode(response.responseText);
    cityStore.loadData(obj.data);
    }
    })
    }
    }
    }


    })

  2. #2
    Sencha Premium User suzuki1100nz's Avatar
    Join Date
    Apr 2011
    Location
    New Zealand
    Posts
    714
    Vote Rating
    236
      0  

    Default

    Please edit your post and use code blocks

Posting Permissions

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