PDA

View Full Version : Store shows incorrect data



lauralxj
21 Aug 2009, 12:52 AM
var form = new Ext.FormPanel({
title: "Load Data From Server",
autoHight: true,
laberAlign: "top",
width: 400,
frame: true,
renderTo: "formpanel",
api: {
load: Lauralxj.Method.GetUser,
submit: Lauralxj.Method.AddUser
}
defaults: { labelWidth: 80, anchor: "95%" },
items: [{
xtype: "textfield",
fieldLabel: 'username',
name: "name",
anchor: "90%",
focusClass: "x-form-focus"
}, { xtype: "textfield",
fieldLabel:'password',
name: "pwd",
anchor: "90%",
inputType: "password"
}, {
xtype:'combo',
fieldLabel: 'sex',
name: 'sex',
anchor: "90%",
mode:'local',
displayField: 'sex'

}
],
buttons: [{
text: "save data",
handler: function() {
form.getForm().load();
}
}, {
text: "Get data",
handler: function() {
form.getForm().submit();
}
}]
});
return json data:


{"type":"rpc","tid":3,"action":"Method","method":"GetUser","result":{"success":true,"data":{"name":"lauralxj","pwd":"123456","sex":["man","woman"]}},"message":null}
but named sex combox result :man,woman
why? Thanks

evant
21 Aug 2009, 1:35 AM
You need to specify a store for a combo box. Moving this to help.