Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9215187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:08:55+00:00 2026-06-18T02:08:55+00:00

Just getting frustrated by something that should be an easy fix, but I’m too

  • 0

Just getting frustrated by something that should be an easy fix, but I’m too simple minded to see it 🙂

I’m having a grid where 1 column is a combobox. The thing works just fine and the correct value is beeing sent through my ajax request, but after I edited the grid row, the combobox disappread and the value that comes into place is not the label, but the value.

editor: new Ext.form.field.ComboBox({
            typeAhead: true,
            lazyRender: true,
            store: new Ext.data.ArrayStore({
                fields: ['contact', 'contactLabel'],
                data: [
                    [1,'Jan'],
                    [2,'Jeroen'],
                    [3,'Mattijs'],
                    [4,'Sven'],
                    [5,'Thomas'],
                    [6,'Yoran']
                ]
            }),
            valueField: 'contact',
            displayField: 'contactLabel',
            hiddenName: 'contact'
        })

So what happens is that when I change the combobox to i.e.. “Thomas”, the value of the cell becomes “5”, instead of “Thomas”. I thought that defining value/display fields would make a difference, but it does not.

Anyone that knows the answer?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:08:56+00:00Added an answer on June 18, 2026 at 2:08 am

    I am not quite sure if I got you right. If so you will need a renderer for that. I guess the example below the code snipped should show you if you are meaning such a case.

    // the renderer. You should define it within a namespace
    var comboBoxRenderer = function(combo) {
      return function(value) {
        var idx = combo.store.find(combo.valueField, value);
        var rec = combo.store.getAt(idx);
        return (rec === null ? '' : rec.get(combo.displayField) );
      };
    }
    
    // the edit combo
    var combo = new Ext.form.ComboBox({
      store: store,
      valueField: "value",
      displayField: "text"
    });
    

    See this full working example for both (cellEditing + rowEditing) JSFiddle ()

    Here’s the complete code

    Ext.create('Ext.data.Store', {
        storeId:'simpsonsStore',
        fields:['name', 'email', 'phone', 'id'],
        data:{'items':[
            {"name":"Lisa", "email":"lisa@simpsons.com", "phone":"555-111-1224","id": 0},
            {"name":"Bart", "email":"bart@simpsons.com", "phone":"555-222-1234","id": 1},
            {"name":"Homer", "email":"home@simpsons.com", "phone":"555-222-1244","id": 2},
            {"name":"Marge", "email":"marge@simpsons.com", "phone":"555-222-1254","id": 3}
        ]},
        proxy: {
            type: 'memory',
            reader: {
                type: 'json',
                root: 'items'
            }
        }
    });
    
        // the combo store
    var store = new Ext.data.SimpleStore({
      fields: [ "value", "text" ],
      data: [
        [ 0, "Option 0" ],
        [ 1, "Option 1" ],
        [ 2, "Option 2" ],
        [ 3, "Option 3" ]
      ]
    });
    
    // the renderer. You should define it within a namespace
    var comboBoxRenderer = function(combo) {
      return function(value) {
        var idx = combo.store.find(combo.valueField, value);
        var rec = combo.store.getAt(idx);
        return (rec === null ? '' : rec.get(combo.displayField) );
      };
    }
    
    // the edit combo
    var combo = new Ext.form.ComboBox({
      store: store,
      valueField: "value",
      displayField: "text"
    });
    
    
    // demogrid
    Ext.create('Ext.grid.Panel', {
        title: 'Simpsons',
        store: Ext.data.StoreManager.lookup('simpsonsStore'),
        columns: [
            {header: 'Name',  dataIndex: 'name', editor: 'textfield'},
            {header: 'Email', dataIndex: 'email', flex:1,
                editor: {
                    xtype: 'textfield',
                    allowBlank: false
                }
            },
            {header: 'Phone', dataIndex: 'phone'},
            {header: 'id', dataIndex: 'id', editor: combo, renderer: comboBoxRenderer(combo)}
        ],
        selType: 'cellmodel',
        plugins: [
            Ext.create('Ext.grid.plugin.CellEditing', {
                clicksToEdit: 1
            })
        ],
        height: 200,
        width: 400,
        renderTo: 'cell'
    });
    // demogrid
    Ext.create('Ext.grid.Panel', {
        title: 'Simpsons',
        store: Ext.data.StoreManager.lookup('simpsonsStore'),
        columns: [
            {header: 'Name',  dataIndex: 'name', editor: 'textfield'},
            {header: 'Email', dataIndex: 'email', flex:1,
                editor: {
                    xtype: 'textfield',
                    allowBlank: false
                }
            },
            {header: 'Phone', dataIndex: 'phone'},
            {header: 'id', dataIndex: 'id', editor: combo, renderer: comboBoxRenderer(combo)}
        ],
        selType: 'rowmodel',
        plugins: [
            Ext.create('Ext.grid.plugin.RowEditing', {
                clicksToEdit: 1
            })
        ],
        height: 200,
        width: 400,
        renderTo: 'row'
    });
    

    html

    <div id="cell"></div>
    <div id="row"></div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just getting started with OpenFrameworks and I'm trying to do something that should be
I am getting frustrated over a java.net.SocketOutputStream that just refuses to flush properly! I
I am getting frustrated with Google query's on code so I'll just ask all
Just getting into the NoSQL stuff so forgive me if this is a simple
I'm getting increasingly frustrated with Flex's Dictionary (which is really just an array with
OK, knowledgeable programmer-types, please be gentle... I'm having trouble getting a very simple, one-view
So from the code you can see that it should be echoing the points
What I'm trying to do is quite simple but as a beginner I'm getting
I'm really frustrated with getting going using VIM. I'm just trying to do some
I'm creating something that has save files. For the most part, it's just saving

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.