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

  • Home
  • SEARCH
  • 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 7058091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:04:17+00:00 2026-05-28T04:04:17+00:00

I have ExtJS Grid. And I am using Roweditor plugin with combobox. When I

  • 0

I have ExtJS Grid. And I am using Roweditor plugin with combobox. When I click on any row of the Grid, I can see the Editor with Update and Cancel button.

Now the problem that I am facing is when I click on the Row and the row editor gets enabled, If the currently displayed value is matched with the combo store, then it should show as selected, but it is not showing that. If I use the value for both valueField and displayField then I can see it selected.

I guess I can not post the images so I am giving you the code here:

If I use the value for both valueField and displayField in the Combo’s Store, then I can see the selected value.

editor: {
    allowBlank: true,
    selectOnFocus:true,
    editable:true,
    xtype:'combobox',
    valueField:'id',
    displayField:'status',
    triggerAction:'all',
    queryMode: 'local',
    store:[['NOT_STARTED','NOT_STARTED'],
           ['IN_PROGRESS','IN_PROGRESS'],
           ['COMPLETED','COMPLETED']
    ],
    value:0,
    lazyRender: true
}

When I assign displayField and valueField differently in the Combo’s Store, which is the ideal case, it is not showing me the selected.

editor: {
    allowBlank: true,
    selectOnFocus:true,
    editable:true,
    xtype:'combobox',
    valueField:'id',
    displayField:'status',
    triggerAction:'all',
    queryMode: 'local',
    store:[['1','NOT_STARTED'],
           ['2','IN_PROGRESS'],
           ['3','COMPLETED']
    ],
    value:0,
    lazyRender: true
}

Please tell me what is wrong here.


Hi Thanks for the reply, I have done the changes as you suggest , but somehow it didn’t work for me. Here is Code. My store is

 var data = {
            root: [
                                                {
                                                    "objectType":"com.yagna.common.domain.Project",
                                                    "objectId":"3072",
                                                    "expectedEndDate":"",
                                                    "startDate":"2011-06-27 13:06:00.0",
                                                    "name":"Milestone-11",
                                                    "actualEndDate":"",
                                                    "id":"4376",
                                                    "Status":"NOT_STARTED"
                                                }] };  

                                                                                     my Column is 

{id: 'Status',width: 20,text: 'Status',dataIndex: 'Status',filter: {type: 'combobox'},sortable: true, groupable: false,
        editor:{
                allowBlank: true,
                xtype:'combobox',
                valueField:'field1',
                displayField:'field2',
                triggerAction:'all',
                mode: 'local',
                store: [['0','NOT_STARTED'],['1','IN_PROGRESS'],['2','COMPLETED']],
                value:0,
                lazyRender: true
            } },   

                                                   Please suggest what is missing here
  • 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-05-28T04:04:17+00:00Added an answer on May 28, 2026 at 4:04 am

    “If the currently displayed value is matched with the combo store, then
    it should show as selected, but it is not showing that”

    A combobox doesn’t match with the displayField value it matches with the valueField value.

    A combobox datastore that is hardcoded like yours will automatically take the first item (e.g. ‘1’) as the valueField and the second item (e.g. ‘NOT_STARTED’) as the displayField.

    Because none of the “number” values (‘1′,’2′,’3’) match to the values in this column (“NOT_STARTED”, “IN_PROGRESS”, “COMPLETED”) it wont show you anything.

    Unless I understood this wrongly, it sounds like the datastore for the grid itself contains this “status” column data (or whatever you call this column) as a string and not a number (i.e. “NOT_STARTED”, “IN_PROGRESS”, “COMPLETED” instead of 1, 2, 3).

    You can do two different things:

    EASIEST: Just leave the value field as a string don’t make it a number.

    HARDER: If you really need this to be a number for some (unstated) reason:

    1. You change the data in the grid datastore so that all the data
      for this column is a number (1,2,3) instead of a string.
    2. Add a renderer config to this column to show the numbers as the
      appropriate strings when a row is not being edited.
    3. Then, do it the way you are trying to with the data store set-up as
      [number - string] objects. Also, take the number out of quotes in your store if
      you are going to do it that way.

    Of course if you are already using a renderer config on this column the problem may simply be that you have the number in quotes.

    Hopefully this all makes sense.

    EDIT:

    Here is the code.

    First, put the status elements in a seperate store – like so:

    var statusStore = Ext.create('Ext.data.SimpleStore', {
        fields: ['id', 'status'],
        data : [
            ['0', 'NOT_STARTED'],
            ['1', 'IN_PROGRESS'],
            ['2', 'COMPLETED']
        ]
    });
    

    Second, change the value of “status” to the number string you wanted (“0”)

    var data = {
        root: [{
            "objectType":"com.yagna.common.domain.Project",
            "objectId":"3072",
            "expectedEndDate":"",
            "startDate":"2011-06-27 13:06:00.0",
            "name":"Milestone-11",
            "actualEndDate":"",
            "id":"4376",
            "Status":"0"
        }]
    };  
    

    Third, add a renderer to your column config and change the store specified in the editor to be the one we created above instead (statusStore).

    {
        id: 'Status',
        width: 20,
        text: 'Status',
        dataIndex: 'Status',
        filter: {type: 'combobox'},
        sortable: true, 
        groupable: false,
        // add this renderer
        renderer: function(value) {
            var idx = statusStore.find('id', value)
            var rec = statusStore.getAt(idx);
            return rec.get('status');                    
        },
        editor:{
            allowBlank: true,
            xtype:'combobox',
            valueField:'field1',
            displayField:'field2',
            triggerAction:'all',
            mode: 'local',
            // change this store to refer to the one we created
            store: statusStore,
            value:0,
            lazyRender: true
        }
    },       
    

    If this pans out for you, don’t forget to mark the check for the answer at the left.

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

Sidebar

Related Questions

I am using extjs grid, and I have a jQuery timer, which will call
I am working on my first project using ExtJS. I have a Data Grid
I have a problem with a Ext.Grid.EditorGridPanel, I am currently using ExtJS 2.3.0, that
I use Extjs 4. I have grid within row expander with data from the
I am using Extjs 4 with Designer 1.2.0. I am using Row Editing Plugin
ExtJS 4. I have grid and editor for it. Editor have listener. How to
I have an ExtJS grid on a web page and I'd like to save
I am using the ExtJS framework and I have the following handler that is
I'm using ExtJS on a registration page which should have no effect on this.
I'm using ExtJS 2.2.1 In my web app, I used to have a TreePanel

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.