PDA

View Full Version : combobox typeahead and forceselection problem



voytaz78
29 Aug 2012, 10:31 PM
I have a problem with combobox with typeahead and forceselection, if I type first letter, the text is reset and i must type first lettter again. This is config of combo:
{ xtype:'combo',
name:'userId',
fieldLabel:'user',
labelWidth:80,
store:storeUserNames,
valueField:'id',
displayField:'fullName',
listConfig:{loadMask:false},
editable:false,
forceSelection:true,
queryMode:'local'}

voytaz78
29 Aug 2012, 10:37 PM
Sorry this is correct config:
xtype:'combo',
name:'clientId',
fieldLabel:'Klient',
forceSelection:true,
displayField:'name',
valueField:'id',
queryMode:'local',
store:storeClientNamesByUser,
typeAhead:true,
minChars:1,
listConfig:{loadMask:false},
labelWidth:80,
width:300

scottmartin
29 Aug 2012, 10:55 PM
Can you explain this a little better as to what you see as wrong?
I do not see the behavior you describe.



var states = Ext.create('Ext.data.Store', {
fields: ['abbr', 'name'],
data : [
{"abbr":"AL", "name":"Alabama"},
{"abbr":"AK", "name":"Alaska"},
{"abbr":"AZ", "name":"Arizona"}
]
});

// Create the combo box, attached to the states data store
Ext.create('Ext.form.ComboBox', {
fieldLabel: 'Choose State',
store: states,
queryMode: 'local',
forceSelection: true,
typeAhead:true,
displayField: 'name',
valueField: 'abbr',
renderTo: Ext.getBody()
});


Scott

voytaz78
29 Aug 2012, 11:44 PM
hello

I have found problem, tread can closed

scottmartin
30 Aug 2012, 5:21 AM
Please post your solution so others can benefit.

Regards,
Scott.

tvanzoelen
30 Aug 2012, 5:33 AM
I like that smiley in the code.... :)

scottmartin
30 Aug 2012, 6:15 AM
Perhaps it was using the wrong emoticon .. :D

Scott.

tvanzoelen
30 Aug 2012, 6:23 AM
store:DtoreClientNamesByUser,

thats indeed much better