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 9018917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:39:10+00:00 2026-06-16T04:39:10+00:00

I am using ExtJs in my application and I have a grid which has

  • 0

I am using ExtJs in my application and I have a grid which has a unique column. This column has an editor which is a combobox, so when I click in a grid cell one combobox is shown. However when I click to edit the grid cell value the name of my object is visible, but when I click outside the cell the value that is render in my grid is the id of object.

When I choose the item:

enter image description here

When I click outside the combobox:

enter image description here

My code:

Ext.define('ComboBoxDoenca', {
extend : 'Ext.form.ComboBox',
displayField: 'nome',
editable: false,
width: 300,
valueField: 'id',
listeners:{
    render: function(combo){
        combo.store = Ext.create('ComboStore').load();
    }
}

});

Grid Code:

Ext.define('GridDoenca', {
extend : 'Ext.grid.Panel',
title: 'Doenças',
alias : 'widget.doencaList',
id: 'gridDoenca',
height: 150,
plugins: [Ext.create('Ext.grid.plugin.CellEditing', {
    clicksToEdit: 1
})],
initComponent : function() {
    var comboDoenca = Ext.create('Hemisphere.view.fungicida.ComboBoxDoenca');
    me = this;
    Ext.apply(this, {
        dockedItems : [ {
            xtype : 'toolbar',
            dock : 'top',
            items : [ {
                text : 'Add Doença',
                icon : Webapp.icon('add1.png'),
                iconAlign : 'top',
                action : 'addDoenca'
            }]
        } ]
    });

    this.columns = [ {
        header : 'ID',
        dataIndex : 'id',
        hidden: true
    },{
        header : 'Doença',
        dataIndex : 'id',
        editor: comboDoenca,
        flex: 1
    }];
    this.callParent(arguments);
}

});

Anybody could help me??

  • 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-16T04:39:11+00:00Added an answer on June 16, 2026 at 4:39 am

    Well, grid column display the real value assigned to it. That means that internally, data is been assigned perfectly.

    The problem you have is you don´t want to see the id value but its friendlier representation instead. That can be solve with the renderer function.

    Please, take a look at my example here: http://jsfiddle.net/lontivero/aP4Kg/

    I have defined my data store as follow:

    Ext.create('Ext.data.Store', {
        storeId:'simpsonsStore',
        fields:['name', 'email', 'phone'],
        data: [
            {"name":"1", "email":"lisa@simpsons.com", "phone":"555-111-1224"},
            {"name":"2", "email":"bart@simpsons.com", "phone":"555-222-1234"},
            {"name":"3", "email":"home@simpsons.com", "phone":"555-222-1244"},
            {"name":"4", "email":"marge@simpsons.com", "phone":"555-222-1254"}
        ]
    });
    

    And this is the names store for my combobox:

    var names = Ext.create('Ext.data.Store', {
        fields: ['id', 'name'],
        data : [
            {"id":"1", "name":"Bart"},
            {"id":"2", "name":"Homer"},
            {"id":"3", "name":"Marge"},
            {"id":"4", "name":"Lisa"}
        ]
    });
    

    As you see in the first store, the “name” field contains an id but, of course, I don´t want to see those numbers, I want to see Bart, Homer, Marge or Lisa.

    Then, in the renderer function I transform those ids in names to display them.

    renderer: function(value) {
        var idx = names.find('id', value)
        var rec = names.getAt(idx);
        return rec.get('name');                    
    }    
    

    I hope this is waht you are looking for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this article of architecture http://blog.extjs.eu/know-how/writing-a-big-application-in-ext/ I have this one function where
I am using this article of architecture http://blog.extjs.eu/know-how/writing-a-big-application-in-ext/ in my code: I have this
I am developing application using ExtJS 4.1. I have one spinner field and I
I'm using extjs mvc style to create a web application. I don't have any
I am using Neo4j and ExtJS in my application. One good thing is that
I have an application using OpenLayers , Extjs and GeoExt . My application runs
I have a JavaScript application which opens an ExtJS Window, containing an ExtJS TabPanel,
I am using Extjs for my application. Which event/listener is fired when extjs completely
I have an intranet web application which uses iframes. The outer web-page has a
I am new to ExtJS and have written a sample App using Ext.application with

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.