Results 1 to 5 of 5

Thread: Editable grid comobox issue

  1. #1

    Default Editable grid comobox issue

    Hi,

    I have a grid which is editable. In that i have column which has combox editable field. If i do like

    Code:
        displayField: 'value',
        valueField: 'key',
    key value gets displayed after selecting a value. If i change to

    Code:
        displayField: 'value',
        valueField: 'value',


    i cannot pass key to server when saving data.
    Code:
    Ext.define('Abc.store.packageType', {
        extend: 'Ext.data.Store',
        alias: 'store.packageType',
        fields: ['value','key'],
        proxy: {
            type: 'memory',
            reader: {
                type: 'array'
            }
        },
        data: [
            ["All", "All"],
            ["Australia", "AUS"],
            ["Kenya", "KEN"]
            
        ]
    });
    
    Ext.define('Abc.view.component.editor.Package', {
        extend: 'Ext.form.field.ComboBox',
        xtype: 'Package',
        editable: false,
        displayField: 'value',
        valueField: 'key',
        queryMode: 'local',
        store: {
            type: 'packageType'
        }
    });
    
    
    Ext.define('Abc.view.component.grid.Packet', {
         extend: "Ext.grid.column.Column",
         text: 'Package',
         width: 100,
         dataIndex: 'Packet',
         autoSizeColumn: true,
         minWidth: 75,
         xtype: 'packetGrid',
         editor: {xtype: 'Package'}
     });

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    I wouldn't expect that to cause problems, but if you want the valueField to be the same as the displayField, you can omit it. The default value of valueField is the value of the displayField.

  3. #3

    Default

    Hi, May be i was not clear with my question. When displaying i want to see displayField and when sending data to server i want to sent valueFiled. Scenario 1: When i use lke displayField: 'value',valueField: 'key' When i select a value from drop down while editing, and move to next field it shows key value in the box and not the display value. Which is wrong. I want it to show always display value and when sending data to server, it should provide me key value. Its not happening.

    Please see the fiddle. Edit the first field, select Australia and come out. Grid column value changes to Aus instead of Australia

    https://fiddle.sencha.com/#fiddle/1dtt

  4. #4
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    I believe that you need to put a renderer on the column to display as desired.
    https://www.sencha.com/forum/showthread.php?155463

  5. #5

    Default

    Hi,

    I tried using rendered like

    Code:
        renderer:function(v){
            return v.value;
        }
    but did not work. Can you see if u can change the fiddle and let me know how to do it, it would be of great help.

    https://fiddle.sencha.com/#fiddle/1dtt

Similar Threads

  1. Editable Grid Performance Issue
    By anant.choubey in forum Ext: Q&A
    Replies: 1
    Last Post: 27 Feb 2015, 9:43 AM
  2. Issue with Editable Grid
    By Karthik gwt in forum Ext GWT: Q&A
    Replies: 0
    Last Post: 13 Mar 2013, 10:29 PM
  3. Ext.ux.touch.grid editable issue
    By tomlobato in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 23 Jan 2012, 7:59 AM
  4. editable grid scrolling issue
    By mshepherd in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 8 Oct 2010, 3:39 AM
  5. Editable Grid and ComboBox issue
    By ak_mike in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 9 Jun 2009, 7:23 PM

Tags for this Thread

Posting Permissions

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