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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:35:30+00:00 2026-05-25T16:35:30+00:00

I am using ExtJs 3.3.1. Within an EditorGrid, my editable column has a ComboBox

  • 0

I am using ExtJs 3.3.1.

Within an EditorGrid, my “editable” column has a ComboBox as its editor. How can I have the ComboBox always showing for each row? Meaning, the user would not have to click on a cell to know there is a ComboBox there. Currently, I have clicksToEdit set to 1, but I wish I could set this to 0 (I tried that).

See some of my code below to see my current configuration.

var combo = new Ext.form.ComboBox({
    typeAhead: true,
    triggerAction: 'all',
    lazyRender: true,
    mode: 'local',
    store: new Ext.data.ArrayStore({
        id: 0,
        fields: [
            'statusId',
            'displayText'],
        data: data
    }),
    valueField: 'statusId',
    displayField: 'displayText'
});

var cm = new Ext.grid.ColumnModel({
    columns: [{
        id: 'orderId',
        header: 'ID',
        dataIndex: 'id',
        width: 50
    }, {
        header: 'Status',
        dataIndex: 'status',
        width: 130,
        editor: (data.length == 1) ? null : combo,
        renderer: Ext.util.Format.comboRenderer(combo)
    }, {
        id: 'orderSummary',
        header: 'Summary',
        dataIndex: 'summary',
        renderer: this.renderSummary
    }]
});

var orderGrid = new Ext.grid.EditorGridPanel({
    store: this.getOrderStore(),
    cm: cm,
    autoExpandColumn: 'orderSummary',
    clicksToEdit: 1
});
  • 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-25T16:35:31+00:00Added an answer on May 25, 2026 at 4:35 pm

    Here is the solution I came up with.

    1. In my column model, I made sure that the column I am making “editable” has an id. Each cell in that column will now have a CSS class associated with it named “x-grid-col-{id}”. My column id is “status” so the class was “x-grid-col-status”.

    2. I created the CSS for class “x-grid-col-status” which sets the dropdown arrow image as the background, aligned right. It also sets the cursor to pointer, so the user knows they can click on the cell.

      .x-grid3-col-status
      {
          background-image: url(Image/trigger-single.gif);
          background-position: right;
          background-repeat: no-repeat;
          cursor: pointer;
      }
      
    3. Next, I set up a listener for my ComboBox that listens for the ‘focus’ event. On focus, I expand the drop down. It is important that I had to add lazyInit: false to my ComboBox config, or else an empty list will appear when you expand. lazyInit – true to not initialize the list for this combo until the field is focused (defaults to true)

    The code:

        Ext.util.Format.comboRenderer = function (combo) {
                return function (value, metaData, record, rowIndex, colIndex, store) {
                    var record = combo.findRecord(combo.valueField, value);
                    return record ? record.get(combo.displayField) : combo.valueNotFoundText;
                }
            }        
    
        var combo = new Ext.form.ComboBox({
                typeAhead: true,
                triggerAction: 'all',
                lazyInit: false,
                lazyRender: true,
                mode: 'local',
                editable: false,
                store: new Ext.data.ArrayStore({
                    id: 0,
                    fields: [
                        'statusId',
                        'displayText'
                    ],
                    data: data
                }),
                valueField: 'statusId',
                displayField: 'displayText',
                listeners: {
                    'focus': {
                        fn: function (comboField) {
                            comboField.doQuery(comboField.allQuery, true);
                            comboField.expand();
                        }
                        , scope: this
                    }
                    , 'select': {
                        fn: function (comboField, record, index) {
                            comboField.fireEvent('blur');
                        }
                        , scope: this
                    }
                }
            });
    
            var cm = new Ext.grid.ColumnModel({
                defaults: {
                    sortable: true
                },
                columns: [
                    {
                        id: 'orderId',
                        header: 'ID',
                        dataIndex: 'id',
                        width: 50
                    }, {
                        header: 'Status',
                        id: 'status',
                        dataIndex: 'status',
                        width: comboColumnWidth,
                        editor: combo,
                        renderer: Ext.util.Format.comboRenderer(combo)
                    }, {
                        id: 'orderSummary',
                        header: 'Summary',
                        dataIndex: 'summary',
                        renderer: this.renderSummary
                    }
                ]
            });
    
            var orderGrid = new Ext.grid.EditorGridPanel({
                store: this.getOrderStore(),
                cm: cm,
                autoExpandColumn: 'orderSummary',
                title: title,
                clicksToEdit: 1
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using extjs combobox for a sex field. It have two value M
I am using ExtJS 3.4 . I have a structure with data for combobox
I am using extjs(3.6) store. In that we can query with single column and
I'm using ExtJS 2.2.1 In my web app, I used to have a TreePanel
I'm using ExtJS on a registration page which should have no effect on this.
I am using the ExtJS framework and I have the following handler that is
I'm using extjs and just trying to solve a simple problem: I have a
Using ExtJS 4.0.2 , I can type the following into the console: Ext.util.Format.date('2012-01-13', m-d-Y);
I'm using ExtJS 3.2 and have content inside of a tab panel, and the
I want to know if we can create reports using EXTJS. Thnx a lot

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.