PDA

View Full Version : [CLOSED] [4.1.0PR] Combobox number of displayed items does not adjust



zombeerose
16 Nov 2011, 6:56 AM
REQUIRED INFORMATION

Ext version tested:

Ext 4.1 rev 0
Browser versions tested against:

FF7 (firebug 1.8 installed)
DOCTYPE tested against:

Strict
Description:

The number of items being displayed in a combo does not auto-adjust based on the bound store.
On a side note, the width of the bound list does not match the width of the combo.
Steps to reproduce the problem:

Run the code.
Expand the combo. Notice that 4 rows are displayed.
Click the Remove button one time.
Expand the combo. Notice the empty row and 3 times displayed.
Click the Add button one time.
Expand the combo. Notice the new value displayed on the 4th row.
Click the Add button again.
Expand the combo. Notice that only 4 rows are still displayed.
The result that was expected:

The number of items displayed in the combo should reflect the items in the store barring any maximum config option.
The result that occurs instead:

Blank rows are displayed or items are missing from the display.
Test Case:


Ext.create('Ext.data.Store', {
storeId:'simpleStore',
fields:[
{name:'id',type:'int'},
'name'
],
data:{'items':[
{"id":"1","name":"Lisa"},
{"id":"2","name":"Bart"},
{"id":"3","name":"Homer"},
{"id":"4","name":"Marge"}
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});


Ext.create('Ext.form.field.ComboBox',{
store: 'simpleStore',
displayField: 'name',
fieldLabel: 'Combo height does not change',
labelWidth: 200,
matchFieldWidth: true,
valueField: 'id',
width: 200,
renderTo: Ext.getBody()
});


Ext.create('Ext.toolbar.Toolbar',{
items: [{
text: 'Add',
handler: function(){
var ds = Ext.data.StoreManager.lookup('simpleStore');
ds.add({
'id':ds.getCount()+1,
'name': new Date().getTime()+''
});
ds.sync();
}
},{
text: 'Remove',
handler: function(){
var ds = Ext.data.StoreManager.lookup('simpleStore');
ds.remove(ds.last());
}
}],
renderTo: Ext.getBody()
});




HELPFUL INFORMATION

Additional CSS used:

only default ext-all.css
Operating System:

WinXP Pro

mitchellsimoens
19 Nov 2011, 2:18 PM
Just tested in our latest code and it is working properly and the BouldList's width is correct also. So this will be in the next release.