PDA

View Full Version : Combobox, dialog, form and a bit problem



evilized
10 Oct 2007, 8:57 AM
hi :)

i've a bit problem with a combobox "loaded from my server with a store", when i show my dialog, i make a ajax resquest for load the form with information, but in the combo o see the id of a category and not the name :S

any body have an idea???


my comboboix definition:


new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
store:this.modalidad,
displayField:'md_description',
name: 'md_id',
forceSelection:true,
fieldLabel:'Modalidad',
editable:false,
valueField:'md_id',
hiddenName:'md_id'
})

a json response from the server.


([{
"ct_obs":"nombre con \u00d1 XD y probando las caracteristicas utf8!!!!",
"md_id":"1",
"c_rut":"22.222.222-2",
"ct_horas":"45",
"ct_valum":"35000",
"ct_nalum":"10",
"ct_vtotal":"350000",
"cc_id":"3",
"ct_id":"11",
"ct_fecha":"2007-10-01",
"ct_curso":"Nombre con \u00d1 xD","s_id":"0"
}])


and i use form.setValues for set the information from json in my form.


pd: i attach a few screeshots of this.

catacaustic
10 Oct 2007, 4:51 PM
This happens because the data store that's attached to the ComboBox hasn't been loaded yet. It's a pretty common problem with the ComboBox's.

When you set the value of a ComboBox, it looks through the attached store to find a matching value. If the store is loaded and there's no matching value, it will display the error message you set for that. But, if the store isn't loaded it will display the value that you send to it because there's nothing for it to look through to find the corresponding value.

evilized
11 Oct 2007, 6:08 AM
thx for the info. (it is like very interesting :) )


can anybody give me a direction for solver my problem please..... :(

thx for any comment or help

catacaustic
11 Oct 2007, 10:18 PM
To solve your problem you either need to load the store for the ComboBox before the value is set for it, or you need to load the display value with the other values somehow, and set that to display. That's the only ways to do it.

evilized
12 Oct 2007, 9:59 AM
To solve your problem you either need to load the store for the ComboBox before the value is set for it, or you need to load the display value with the other values somehow, and set that to display. That's the only ways to do it.

i'm going to solver my problem with u comment.

:)

thx u very much!