Results 1 to 2 of 2

Thread: Store shows incorrect data

  1. #1

    Default Store shows incorrect data

    Code:
    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:
    Code:
    {"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

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    You need to specify a store for a combo box. Moving this to help.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •