PDA

View Full Version : [SOLVED] Select index combo box getForm().load



vaucer
14 Feb 2010, 7:42 AM
Hello,

I load data into a form with getForm().load method.

My textfield are correctly populate with good value form the load of the form, but i don't know the good way to do this with my combo box...

If anyone can help me about this cosmetic problem you save my life, i tried many solution founded on forums but it didn't help.

My specific combobox datastore:

var storeCritik = new Ext.data.SimpleStore({
fields: ['id','Critik'],
data : [['1','*'],['2','**'],['1','***']]
});My form with my combobox:

var simple = new Ext.FormPanel({
id:'simple',
reader: new Ext.data.XmlReader({
record: 'response',
totalProperty: 'total',
id: 'idr'
},[
{name: 'ID',mapping: 'idr'},
{name: 'differ',mapping: 'differ'},
{name: 'critik',mapping: 'critik'}
]),
labelWidth: 75, // label settings here cascade unless overridden
frame:true,
title: 'Simple Form',
bodyStyle:'padding:5px 5px 0',
width: 350,
defaults: {width: 230},
defaultType: 'textfield',

items: [{
fieldLabel: 'First Name',
id:'Identifiant',
name: 'ID',
allowBlank:false
},{
fieldLabel: 'Last Name',
name: 'differ'
},{
xtype: 'combo',
name: 'critik',
fieldLabel: 'Criticité',
store: storeCritik,
displayField:'Critik',
valueField:'id',
typeAhead: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
allowBlank: false,
disabled: true,
emptyText:''
}],

buttons: [{
text: 'Save'
},{
text: 'Cancel'
}]
});And finally i load my store manually in function like this:

simple.getForm().load({
url: 'php/sibes/map_sib.php',
method: 'POST',
params: {task:"LISTINGFORM",id:Ext.getCmp('Identifiant').getValue()}
});I want just select the value contain in the reader of my form "critik" in my combobox.

Thank you very if you have time to help me.

Sorry for my english

Vaucer

vaucer
14 Feb 2010, 8:12 AM
Ok finally is ok. I don't know where have been the problem but all work now. My combobox are well selected.

Still sorry for incoveniences