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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:13:56+00:00 2026-05-30T07:13:56+00:00

I have two EXT JS check columns like this: var maleColumn = new Ext.grid.CheckColumn({

  • 0

I have two EXT JS check columns like this:

var maleColumn = new Ext.grid.CheckColumn({
    dataIndex: 'male',
    headerId: 'male'
})
maleColumn .on('click', function(s, e, t, record) {...})

var femaleColumn = new Ext.grid.CheckColumn({
    dataIndex: 'female',
    headerId: 'female'
})
femaleColumn .on('click', function(s, e, t, record) {...})

Now I need to write an onClick event so that when one of these is clicked, the other one is disabled. How can I do it?

  • 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-30T07:13:57+00:00Added an answer on May 30, 2026 at 7:13 am

    First, I should say that’s a bit strange to have two CheckColumn for gender. Why not having one Column that has a combobox for user to select the gender?

    But if you have to do so, I have a solution. My solution is based on Extjs 3.2.1.

    //First, extend Ext.ux.grid.CheckColumn
    MyCheckColumn = Ext.extend(Ext.ux.grid.CheckColumn,{
        //The reference to the related dataIndex
        relatedIndex : null,         
        //Override onMouseDown method
        onMouseDown : function(e, t){
               if(Ext.fly(t).hasClass(this.createId())){
                   e.stopEvent();
                   var index = this.grid.getView().findRowIndex(t);
                   var record = this.grid.store.getAt(index);
               /*
                * By checking the related record data, we can know if the other CheckColumn
                *  is checked or not (true/false means checked/unchecked).
                * If false, we can then check the checkbox that is clicked.
                */
               if(!record.data[this.relatedIndex])
                  record.set(this.dataIndex, !record.data[this.dataIndex]);
               }
        }
    });
    
    //Using MyCheckColumn and include relatedIndex in the config options.
    var maleColumn = new MyCheckColumn({
        dataIndex: 'male',
        relatedIndex: 'female',
        headerId: 'male'
    });
    
    var femaleColumn = new MyCheckColumn({
        dataIndex: 'female',
        relatedIndex: 'male',
        headerId: 'female'
    });
    

    Though the solution works but I don’t recommend it since the implementation may change when extjs upgrades. e.g. For extjs 3.3.1, you have to override another method but not onMouseDown:

    processEvent : function(name, e, grid, rowIndex, colIndex){
            if (name == 'mousedown') {
                var record = grid.store.getAt(rowIndex);
                //Do the changes here like the way I do above...
                record.set(this.dataIndex, !record.data[this.dataIndex]);
                return false; // Cancel row selection.
            } else {
                return Ext.grid.ActionColumn.superclass.processEvent.apply(this, arguments);
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a structure of this type (Ext 3.3.1): var page = new Ext.Viewport({
I have a ton of files that are named like this: nn - xxxxxxxxxxxxxx-OOO.ext
I have two tables like this create table A_DUMMY ( TRADE_ID VARCHAR2(16) TRADE_DATA VARCHAR2(500)
So I have a TabPanel defined like so: panel = new Ext.TabPanel({ fullscreen: true,
I have a store as follows. var eventsStore = new Ext.data.Store({ model: 'Event', sorters:
I have this panel Mobz.views.aPanel = new Ext.Panel({ id: 'apanel ', tpl: aPanel _Template,
I have two Ext.menu.CheckItem's in a group. How would I change the checked item's
I have two elements on my page (two 'cancel' elements). <div unselectable=on class=x-grid-cell-inner x-unselectable
I have an Ext GroupingStore on a list of orders. One of the columns
I have a csv file as this: 1#one#two#three#four; 2#apple#tower#flower#robot; I read this file 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.