PDA

View Full Version : Manually Add item to combobox



zivrozz
3 Jan 2010, 8:38 AM
Hi everyone,

I have a combobox that load its data from a webservice:

var a = "[{name:'Se_Id', type:'int'},{name:'Se_Name'},{name:'Se_Color'},{name:'Se_Flag'},{name:'Se_ExampleProxy'}]";
var sefields = Ext.util.JSON.decode(a);
seStore = createStore('wsDomainTrends', 'selist', 'SearchEngines', sefields, {});


seCombo = new Ext.form.ComboBox({
store:seStore,
valueField: 'Se_Id',
displayField: 'Se_Name',
hiddenName: 'Se_Id',
typeAhead: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
emptyText: 'Select...',
selectOnFocus: true,
applyTo: 'inpSearchEngines',
width: 50
});
seStore.load();

The data is loaded correctly from the store.
What I am trying to do is to manually add to the combobox an item, that will be the first item in the combo and like '<ALL>' with Se_Id=-1

I tried various of ways and failed them all...
please help.
Thanks

zivrozz
3 Jan 2010, 10:06 AM
Well it was my fault, I've found the the < character or the > character in the item I wanted to add '<all>' are invalid and this is why it doesn't show.