PDA

View Full Version : combo list auto height



Vamshi Barana
26 Sep 2013, 9:28 PM
Hi,

Please anybody help me to set auto height of combo list .

slemmon
30 Sep 2013, 2:33 PM
The picker should auto-height already out of the box. Below example tested with 3.4.1.



// simple array store
var store = new Ext.data.ArrayStore({
fields: ['abbr', 'state', 'nick'],
data : [
['AL', 'Alabama', 'The Heart of Dixie'],
['AK', 'Alaska', 'The Land of the Midnight Sun'],
['AZ', 'Arizona', 'The Grand Canyon State']
]
});
var combo = new Ext.form.ComboBox({
store: store,
displayField:'state',
typeAhead: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
emptyText:'Select a state...',
selectOnFocus:true,
renderTo: document.body
});


// simple array store
var store2 = new Ext.data.ArrayStore({
fields: ['abbr', 'state', 'nick'],
data : [
['AL', 'Alabama', 'The Heart of Dixie'],
['AK', 'Alaska', 'The Land of the Midnight Sun'],
['AZ', 'Arizona', 'The Grand Canyon State'],
['AR', 'Arkansas', 'The Natural State'],
['CA', 'California', 'The Golden State'],
['CO', 'Colorado', 'The Mountain State'],
['CT', 'Connecticut', 'The Constitution State'],
['DE', 'Delaware', 'The First State']
]
});
var combo2 = new Ext.form.ComboBox({
store: store2,
displayField:'state',
typeAhead: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
emptyText:'Select a state...',
selectOnFocus:true,
renderTo: document.body
});