Results 1 to 2 of 2

Thread: [CLOSED]from.getValues() returns displayField instead of valueField

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Nov 2008
    Location
    Berlin, Germany
    Posts
    24

    Default [CLOSED]from.getValues() returns displayField instead of valueField

    I think this is a Bug if i am not doing something wrong.

    Here is my simplified code

    PHP Code:
    var myData = new Ext.data.DirectStore({
       
    directFn:Server.getData,
       
    reader: new Ext.data.JsonReader(
       {
    root'data',  totalProperty'total'},
       [
           {
    name'ID',type'int'},   
           {
    name'name'type'string'}
       ]
       ),
       
    sortInfo: {field'name'direction"ASC"},
       
    remoteSort:true
    });

    // only the config of my form for simplicity
    {xtype:"form"id:"my-form"methode:"post"title:"Details",
     
    api: {loadServer.load,submitServer.update},
     
    items: [
      {
    xtype"combo"
       
    id:"my-combo"
       
    storemyData
       
    valueField'ID'
       
    displayField'name'
       
    forceSelectiontrue
       
    mode:'local',
       
    name"combo_name"
      
    }
     ]
    }
       
    // now i have a button which submits the data
    function submit() {
     var 
    form=Ext.getCmp('my-form').getForm();
     
    form.api.submit(form.getValues(), {
      
    method:'POST',
      
    success: function(form,action) {...},
      
    failure: function(formaction) {...}
     }); 

    if i check the received data on my server i get allways the displayField value not the valueField value.
    everything should be fine, because if i call in the submit function
    PHP Code:
    Ext.getCmp('my-combo').getValue(); 
    i get the valueField value as expected.

    if i am doing something wrong please help.

    by the way, i am using ExtJS 3.2.1

  2. #2
    Sencha User
    Join Date
    Nov 2008
    Location
    Berlin, Germany
    Posts
    24

    Default

    solved my self, i was a bit to hasty with the bug report.

    form.getFieldValues() is returning the valueFields as wanted.

    sorry

Similar Threads

  1. [CLOSED][3.0r5636] form.getValues returns displayField
    By Drayton in forum Ext 3.x: Bugs
    Replies: 9
    Last Post: 21 Nov 2009, 5:14 AM
  2. BasicForm.getValues() returns undefined!
    By super_drone in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 9 Nov 2009, 1:41 PM
  3. Form#getValues does not use valueField from ComboBox
    By jonathanv in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 26 May 2007, 4:56 PM
  4. Replies: 1
    Last Post: 22 Apr 2007, 10:18 PM

Posting Permissions

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