PDA

View Full Version : Combobox getting stuck.



deepamleo
4 Apr 2012, 9:03 PM
I have two combobox. One for group and another for members of the group. The second one is dependant on 1st combobox selection/value change. On first time loading it works fine. but on changing the group, the group member combo gets stuck with loading mask symbol.

My code is:


dp.tech = Ext.create('Ext.form.ComboBox', {
id:'techCombo',
fieldLabel: langMap.get('Technician'),
store: dp.techStore,
displayField: 'Name',
valueField: 'Id',
labelAlign: 'right',
labelWidth: 50,
editable:false,
emptyText:'-Select-',
multiSelect:true,
value : techStoreValue,
queryMode : 'remote',
listeners:{
select: function(ele,records) {
dp.resourceStore.clearFilter(true);
//console.log('selected ele value..................'+ele.value);
dp.resourceStore.filterBy(function(record,id){
var isPresent = false;
for(var i=0; i< ele.value.length;i++){
if(ele.value[i] == record.get('Id')){
isPresent = true;
break;
}
}
return isPresent;
});
//userSetting value save
dp.UserSettingStore.getAt(0).set(nsPrefixDp+"Last_Selected_Technicians__c",ele.value) ;
dp.updateUserSetting();
}
}
});


And the Group selection code is:
var group = Ext.create('Ext.form.ComboBox', {
id:'groupCombo',
fieldLabel: langMap.get('Group'),
store: dp.groupStore,
queryMode: 'local',
displayField: 'Name',
valueField: 'Id',
labelAlign: 'right',
labelWidth: 50,
//autoSelect :true,
typeAhead :true,
editable:false,
value:groupvalue,
listeners:{
select: function(ele,records) {
var techQuery = "Select Id, Name, "+nsPrefixBase+"Technician_skills__c from User where IsActive = true and Id in"+dp.groupMemberList;
dp.urlTech = dp.protocol + '://' + dp.sfdcURL+ dp.restAPIURL + '/' + dp.version + '/query?q='+ encodeURIComponent(techQuery);
dp.techStore.getProxy().url = '/services/proxy'; //modify your URL
Ext.apply(dp.techStore.getProxy().headers, {'SalesforceProxy-Endpoint':dp.urlTech});
dp.techStore.each(function() {
dp.techStore.remove(this);
});
dp.techStore.load({
callback : function(records, operation,success) {
techStoreValue = new Array();
for (i=0 ; i< dp.techStore.getCount(); i++){
techStoreValue[i] = dp.techStore.getAt(i).get('Id');
}

scottmartin
5 Apr 2012, 7:49 AM
Are you receiving any errors in the console when this happens?

Regards,
Scott.

friend
5 Apr 2012, 8:11 AM
This is caused by a known bug in Ext.LoadMask. It's supposed to be fixed in the 4.1 release, from what I remember reading.

Here's an override that cures the problem on ExtJs 4.0.7:



// fix for combobox loadmask hanging after reloading store.
Ext.override(Ext.LoadMask, {
onHide: function() { this.callParent(); }
});