PDA

View Full Version : problem with comboBox autoComplete



suitch
20 Nov 2009, 11:41 AM
Hi,
I'va got problem with autoComplete with one of the comboBox on my form. The store linked to this comboBox is defined this way :



var taskCodeStore = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
url: '<%= Url.Action("GetTaskCodes", "Timesheet") %>',
method: 'GET'
}),
fields: ['Id', 'DisplayName', 'IsAffectingTimebank'],
root: 'TaskCodeData',
baseParams: {
projectId: '',
phaseId: ''
}
});


Here is the code defining my comboBox :


items: [{
store: taskCodeStore,
id: 'comboTaskCode',
fieldLabel: '<%= ViewData["LabelTask"] %>',
displayField: 'DisplayName',
valueField: 'Id',
forceSelection: true,
mode: 'remote',
queryParam: 'queryText',
queryDelay: 50,
minChars: '<%= ViewData["MinCharAutoComplete"] %>',
triggerAction: 'all',
selectOnFocus: true,
editable: true,
xtype: 'combo',
editable: true,
width: 250,
hiddenName: 'TaskCode',
value: taskCode,
listeners: { 'select': { fn: function(combo, value) {
SetDefaultDescription();
SetDefaultIsBillable();
SetDefaultIsAffectTimeBank();
}
}
}


The values contained in this comboBox must be filtered depending on the values contained in two other comboBoxes, so everytime an item is selected an eement in one of those two combo, i automatically reload my store (taskCodeStore). The mode on this combo is remote, wich means my autocomplete is done server side by sending a request with the parameter 'queryString' (property queryParam) wich contains the text i'm looking for. Here is my problem, when i first get into my form, this comboBox contains all possible values and autoccomplete just works fine, the request is sent to server with correct params and the return just gave back mathing records. Then i select a value in one of the depending combo, my store is reload and the filtered items are now in my combo. But at this point, the autocomplete is no longer working. Strange thing is with the firefox debug console, i see that the autocomplete sends request to the server and the mathing items are sent back, but my comboBox list doesn't refresh, so i still have all element in the list. Any ideas ?