-
16 Oct 2011 11:06 PM #1
Unanswered: How to make the combobox act like simple dropdown
Unanswered: How to make the combobox act like simple dropdown
While the combo box is rich and provides various features, how can I make it act like simple dropdown. I tried to set typeAhead as false, editable as false. However this still is not close the the old dropdown where I can get to a value in dropdown by just key press. Are there any other settings to make this combo box act like a straight <select> tag?
-
3 Nov 2011 9:51 PM #2
try with this configs...Code:items:[{ flex: 1, xtype:'combo', id:"user_role_99", fieldLabel:"Role", mode:'local', allowBlank:false, blankText:"This field is required", msgTarget:"under", triggerAction:'all', store: roleId_store, //roleId_store is the store name that u wanna show in combobox displayField:'role_id', valueField:"role_id", emptyText:"Select Text..." }]
-
30 Nov 2011 10:04 AM #3
I have some code , try this
I have some code , try this
controls.ISACTIVE = Ext.create('Ext.js.override.ComboBox',{
fieldLabel : "State",
name : "state",
width: 150,
storeData : [{'CODE':'0', 'NAME':'Active'}, {'CODE':'1', 'NAME':'Passive'}]
});
But for use this code you must have my ovveride class.. This ComboBox like to simple DropDown
If you don't want use ovveride class, you must copy features to your ComboBox that enough
-
30 Nov 2011 10:12 AM #4
ComboBox override class for my example
ComboBox override class for my example
Ext.define('Ext.js.override.ComboBox',{
extend: 'Ext.form.field.ComboBox',
typeAhead: false,
selectOnFocus: false,
forceSelection: true,
editable: false,
emptyText: '-',
queryMode: 'local',
minChars: 1,
triggerAction: 'all',
alueField: 'CODE',
displayField: 'NAME',
storeData: null,
storeFields: ['CODE', 'NAME'],
initComponent: function(){
var me = this;
var store;
if(Ext.isArray(me.storeData)){
store = Ext.create('Ext.data.Store',{
fields: me.storeFields,
data: me.storeData
});
}
Ext.apply(me, {
store: store,
});
me.callParent();
}
});
-
30 Nov 2011 11:58 AM #5
See this thread:
http://www.sencha.com/forum/showthre...002#post681119
Near the end I posted some code for keypress jumping to values in the drop-down. It sounds to me like that's what you're looking for.


Reply With Quote