1. #1
    Ext JS Premium Member
    Join Date
    Apr 2009
    Posts
    89
    Vote Rating
    1
    sanjay_1985 is on a distinguished road

      0  

    Default Combo box Ajax

    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
    Touch Premium Member suzuki1100nz's Avatar
    Join Date
    Apr 2011
    Location
    New Zealand
    Posts
    450
    Vote Rating
    66
    suzuki1100nz is just really nice suzuki1100nz is just really nice suzuki1100nz is just really nice suzuki1100nz is just really nice

      0  

    Default


    Please edit your post and use code blocks

Thread Participants: 1