PDA

View Full Version : Combox stops working in 4.1 beta



xxz00
4 Jan 2012, 6:47 PM
Hi,

Looks like combox stops working on some occasions in 4.1 beta. I am not able to select an item from the combox in one of the popup window. The same code works in 4.0.7.

The code snippet:

xtype: 'combo',
name: 'prMeetingId',
store: Ext.data.StoreManager.lookup('fivetab-meetingsStore'),
displayField: 'meetingName',
valueField: 'id',
queryMode: 'local',
emptyText: 'select one meeting',
fieldLabel: 'meeting',
allowBlank: false,
flex: 1,

Any idea what changes have been made on Combox in 4.1 beta?

I will also attach the image...

xxz00
5 Jan 2012, 7:17 AM
Okay. I've found the problem. In my application, the combox is inside a form, and the form is inside a window. The store that combox uses needs to be loaded AFTER the window is created. If the store is loaded before the window is created, the combox cannot be selected. This is NOT the case in 4.0.7. So the behavior has been changed in 4.1. Is this a bug?

evant
5 Jan 2012, 1:05 PM
It's hard to say whether this is a bug or not, the description is rather vague. For example if I run this against the 4.1 beta I don't see any issue:



Ext.onReady(function() {

var store = Ext.create('Ext.data.Store', {
fields: ['a', 'b'],
data: [{
a: 1,
b: 'One'
}, {
a: 2,
b: 'Two'
}]
});

Ext.create('Ext.window.Window', {
autoShow: true,
title: 'Window',
layout: 'fit',
width: 200,
height: 200,
items: {
xtype: 'form',
items: {
xtype: 'combo',
store: store,
displayField: 'b',
valueField: 'a'
}
}
})

});

xxz00
10 Jan 2012, 5:34 PM
Your store is different than mine. You are using local store, while I was using AJAX proxy to load data from server. I also set autoload to false since I want to load the data on demand.
In my code, this works:
var win = Ext.create('...');
win.show();
var store = Ext.getStore('storeName');
store.load();

If I move the store.load() method ahead of window creation, the combox does not work. This only happens on 4.1 Beta.