PDA

View Full Version : How can I get the combo box to display more than 14 rows in the drop down?



cswsteve
16 Dec 2012, 9:31 PM
Is there any way to increase the number of visible rows in a combo box drop down? When I click the drop down I currently see about 14 rows but I would like to increase this to show 20.

Thanks

slemmon
16 Dec 2012, 10:44 PM
You can use the listConfig > maxHeight (defaults to 300) to show more in the picker.

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.ComboBox-cfg-listConfig



var comboStore = Ext.create('Ext.data.Store', {
fields: ['number'],
data : [
{number: 1}
, {number: 2}
, {number: 3}
, {number: 4}
, {number: 5}
, {number: 6}
, {number: 7}
, {number: 8}
, {number: 9}
, {number: 10}
, {number: 11}
, {number: 12}
, {number: 13}
, {number: 14}
, {number: 15}
, {number: 16}
, {number: 17}
, {number: 18}
, {number: 19}
, {number: 20}
]
});


Ext.create('Ext.form.ComboBox', {
fieldLabel: 'Picker Limit',
store: comboStore,
queryMode: 'local',
displayField: 'number',
valueField: 'number',
renderTo: Ext.getBody(),
listConfig: {
maxHeight: 450
}
});

cswsteve
17 Dec 2012, 6:19 AM
That looks like it will do exactly what I want but the only problem is I don't see that Config in Sencha Achitect for the ComboBox. Is it called something different in Architect?