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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:24:21+00:00 2026-06-17T22:24:21+00:00

I have an ExtJs EditorGridPanel with a custom renderer. The basic idea is to

  • 0

I have an ExtJs EditorGridPanel with a custom renderer. The basic idea is to display a checkbox when an item needs to be registered and the text Registered when an item is already registered. Everything is working swimmingly except for when clicking on the header, the entire grid re-renders and every cell toggles. Furthermore, the sort does not work. How to I tell when the header has been clicked so that all my checkboxes do not toggle? How do I fix the sort for the column? Right now it does not sort. Thanks in advance for your help.

var colModel = new Ext.grid.ColumnModel(
    {
    columns: [
        { id: 'ItemOid', header: "ItemOid", width: 100, sortable: true, locked: true, dataIndex: 'ItemOid', hidden: true },
        { id: 'nNumber', header: "N-#", width: 100, sortable: true, locked: true, dataIndex: 'NNumber' },
        { header: "Make", width: 150, sortable: true, dataIndex: 'Make' },
        { header: "Model", width: 150, sortable: true, dataIndex: 'Model' },
        { header: "Register",
            width: 55,
            sortable: true,
            dataIndex: 'Register',
            xtype: 'checkcolumn',
            renderer: renderFunction
        }
    ]
    });

function renderFunction(value, metaData, record, rowIndex, colIndex, store) {

    if (!store.getAt(rowIndex).data['ItemNeedsRegistered'])
        return 'Registered';

    var isRegistered = store.getAt(rowIndex).data['Registered'];
    var renderString;

    if (initialItemRender || isRegistered) {
        renderString = '<input type="checkbox" id="chkRegistered' + rowIndex + '" />';
        store.getAt(rowIndex).data['Registered'] = false;
    } else {
        renderString = '<input type="checkbox" checked="yes" id="chkRegistered' + rowIndex + '" />';
        store.getAt(rowIndex).data['Registered'] = true;
    }

    return renderString;
}

var grid = new Ext.grid.EditorGridPanel({
        store: itemStore,
        cm: colModel,
        sm: new Ext.grid.RowSelectionModel({ singleSelect: true }),
        viewConfig: {
            forceFit: true
        },
        height: 100,
        split: true,
        region: 'north'
    });

Here is my second attempt that also fails, by trying to update the underlying value and it does not check or uncheck.

function renderFunction(value, metaData, record, rowIndex, colIndex, store) {

    if (!store.getAt(rowIndex).data['ItemNeedsRegistered'])
        return 'Registered';

    var isRegistered = store.getAt(rowIndex).data['Registered'];
    var renderString;

    if (initialItemRender || !isRegistered) {
        renderString = '<input type="checkbox" id="chkRegistered' + rowIndex + '"' 
        + ' onClick="updateStoreOnClick(' + rowIndex + ', true);"'
        + ' />';
    } else {
        renderString = '<input type="checkbox" checked="yes" id="chkRegistered' + rowIndex + '"'
        + ' onClick="updateStoreOnClick(' + rowIndex + ', false);"'                
        + ' />';
    }

    return renderString;
}

function updateStoreOnClick(rowIndex, value) {
    store.getAt(rowIndex).data['Registered'] = value;
}
  • 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-17T22:24:23+00:00Added an answer on June 17, 2026 at 10:24 pm

    I ended up doing a custom check column:

        //#region Custom Check Column
        AVRMS.AircraftRegisterCheckColumn = Ext.extend(Ext.grid.Column, {
        /**
            * @private
            * Process and refire events routed from the GridView's processEvent method.
            */
            processEvent: function(name, e, grid, rowIndex, colIndex) {
                if (name == 'mousedown') {
                    var record = grid.store.getAt(rowIndex);
    
                    if (grid.store.getAt(rowIndex).data['AircraftNeedsRegistered'])
                        record.set(this.dataIndex, !record.data[this.dataIndex]);
    
                    return false; // Cancel row selection.
                } else {
                    return Ext.grid.ActionColumn.superclass.processEvent.apply(this, arguments);
                }
            },
    
            renderer: function(v, p, rec, rowIndex, colIndex, store) {
                if (!store.getAt(rowIndex).data['AircraftNeedsRegistered'])
                    return store.getAt(rowIndex).data['Status'];
    
                p.css += ' x-grid3-check-col-td';
                return String.format('<div class="x-grid3-check-col{0}">&#160;</div>', v ? '-on' : '');
            },
    
            // Deprecate use as a plugin. Remove in 4.0
            init: Ext.emptyFn
        });
    
        Ext.reg('airRegChkCol', AVRMS.AircraftRegisterCheckColumn);
    
        // register ptype. Deprecate. Remove in 4.0
        Ext.preg('airRegChkCol', AVRMS.AircraftRegisterCheckColumn);
    
        // register Column xtype
        Ext.grid.Column.types.airRegChkCol = AVRMS.AircraftRegisterCheckColumn;
    
        //#endregion
    
    //#region ColumnModel
    var colModel = new Ext.grid.ColumnModel(
        {
            columns: [
                { id: 'AircraftOid', header: "AircraftOid", width: 100, sortable: true, locked: true, hideable: false, dataIndex: 'AircraftOid', hidden: true, menuDisabled: true },
                { id: 'nNumber', header: "N-Number", width: 75, sortable: true, locked: true, hideable: false, dataIndex: 'NNumber', menuDisabled: true },
                { header: "Make", width: 150, sortable: true, hideable: false, dataIndex: 'Make', menuDisabled: true },
                { header: "Model", width: 150, sortable: true, hideable: false, dataIndex: 'Model', menuDisabled: true },
                {
                    header: "Airworthy",
                    width: 75,
                    sortable: true,
                    hideable: false,
                    dataIndex: 'Airworthy',
                    menuDisabled: true,
                    renderer: function (value, metaData, record, rowIndex, colIndex, store) {
                        if (value == true)
                            return 'Yes';
                        return 'No';
                    },
                    editor: new Ext.form.ComboBox({
                        id: 'makeCombo',
                        typeAhead: true,
                        store: airworthy,
                        triggerAction: 'all',
                        forceSelection: true,
                        mode: 'local',
                        allowBlank: false,
                        selectOnFocus: true,
                        lazyRender: true,
                        listClass: 'x-combo-list-small'
                    })
                },
                {
                    id: 'Register',
                    header: "Select to Register",
                    width: 75,
                    sortable: true,
                    dataIndex: 'Register',
                    xtype: 'airRegChkCol',
                    hideable: false,
                    menuDisabled: true
                }]
        });
    
    
    //#endregion
    
    //#region grid
    var grid = new Ext.grid.EditorGridPanel({
        store: aircraftStore,
        cm: colModel,
        sm: new Ext.grid.RowSelectionModel({ singleSelect: true }),
        viewConfig: {
            forceFit: true
        },
        height: 100,
        split: true,
        region: 'north'
    });
    //#endregion
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ExtJS application that needs to display an html document within a
I have a ExtJs application. When user needs to view PDF report generated on
I have used EXTJS for grid display and for pagination also.My problem is that
I have an ExtJs Grid with CheckBoxSelectionModel . Selecting the header checkbox checks all
I have a problem with a Ext.Grid.EditorGridPanel, I am currently using ExtJS 2.3.0, that
I have an ExtJS Panel that displays several bits of data and needs to
I have an EXTJS paging grid with checkbox selection model. I want to know
I have weird situation that extjs 4 always puts last word of custom error
I have an ExtJS EditorGridPanel with several columns. One of the columns is bound
I have a basic ExtJS 4.0 accordion. I want to have an inline link

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.