Hi,
last time i think about something lik this. I have combobox with values from store ('id', 'values') what method use to set 'id' in textfield and 'values' in combo bo select this value
hmm...i wrote something wrong...a would like to do that if i choose from the combobox eg. value_1 in the textfield appears id_1 etc. i would like use it to insert two values to the grid from the combo
ok first step is done
{
fieldLabel: 'abbr',
name: 'abbr',
id:'combo-city',
width:190
},
new Ext.form.ComboBox({
fieldLabel: 'State',
hiddenName:'state',
store: new Ext.data.SimpleStore({
fields: ['abbr', 'state'],
data : Ext.exampledata.states // from states.js
}),
valueField:'abbr',
displayField:'state',
typeAhead: true,
mode: 'local', How refresh combo box content? [Archive] - SYTELINE FORUMS:: I want that this combo change his content when i change the value of another combo, nothing happen with the content of the field's combo box. http://www.syteline7.com/archive/index.php?t-253.htmlHOME |
listeners:{select:{fn:function(combo, value) {
var comboCity = Ext.getCmp('combo-city');
var val1 = combo.getValue();
comboCity.setValue(val1);
}
},
triggerAction: 'all',
emptyText:'Select a state...',
selectOnFocus:true,
width:190
})
here is my code. in combo i have states name and in the textfield are short name of state after select. However when i send this form to the DB values from this two field will be the same (value: 'abbr'). I would like do sth different. values of this two forms willbe different 'abbr' and 'states'
Use:
{
fieldLabel: 'abbr',
name: 'abbr',
id: 'abbrField',
width: 190,
listeners: {
change: function(field, value) {
var stateField = Ext.getCmp('stateField');
var record = state.store.getAt(value);
stateField.setValue(record.get('state')); fieldEditor : comboBox which options depends on the value of :: 1 post - Last post: Jul 16, 2008vendor.cfm?service=XXXXX : XXXXX is the value of service field of i wrote the this code and i get the combobox displayed at the title of http://bdn.backbase.com/node/5171HOME | OL2000: How to Populate a List Box or Combo Box:: There are a variety of ways to populate a list box or combo box on an Outlook form. Leave the Possible Values field blank, and then click OK. http://support.microsoft.com/kb/232341HOME |
}
}
},{
xtype: 'combo',
id: 'stateField',
fieldLabel: 'State',
name:'state',
store: new Ext.data.SimpleStore({
id: 0,
fields: ['abbr', 'state'],
data : Ext.exampledata.states
}),
displayField:'state',
typeAhead: true,
mode: 'local',
listeners: {
select: function(combo, record) { Value not valid for field in Combobox - Access World Forums:: I had the same problem but solved it by disabling the allow filter option of the form. "The value you entered isn't valid for this Field" Combobox http://www.access-programmers.co.uk/forums/showthread.php?p=781549HOME |
var abbrField = Ext.getCmp('abbrField');
abbrField.setValue(record.get('abbr'));
}
},
triggerAction: 'all',
emptyText: 'Select a state...',
selectOnFocus: true,
width: 190
}
hmm...in the same time i made sth like this:
{
fieldLabel: 'abbr',
name: 'abbr',
id:'combo-city',
width:190
},
new Ext.form.ComboBox({
fieldLabel: 'State',
hiddenName:'state',
store: new Ext.data.SimpleStore({
fields: ['abbr', 'state'],
data : Ext.exampledata.states // from states.js
}),
valueField:'abbr',
id:'state',
displayField:'state',
typeAhead: true,
mode: 'local',
listeners:{select:{fn:function(combo, value) {
var comboCity = Ext.getCmp('combo-city');
var val1 = combo.getValue();
comboCity.setValue(val1);
}
},
triggerAction: 'all',
emptyText:'Select a state...',
selectOnFocus:true,
width:190
})
and works good ;)
Condor, thanks for help and move to good road
Use:
var cb = new Ext.form.ComboBox({
store: myStore,
displayField: 'values',
valueField: 'id',
hiddenName: 'id',
...
});
myStore.load({...});
cb.setValue(1);
(or id and values reversed, you're not clear enough on that)
In the select eventhandler of the combobox get the current record and set the value of the textfield.
Where's The Advantage In Windows Genuine Advantage?
Stocks Bounce After S&P Joins Bear Market
|