Search code examples
extjsextjs3

How to set Extjs.grid.CheckColumn to disabled for read only?


I have a grid with check column and check column read my data but i cannot set it,i wondering how to set it with easy way. I want my check column to become view only in my grid data how to set it? below is my example code:

var chkColH = new Ext.grid.CheckColumn({
    header: ' H',
    dataIndex: 'testing',
    resizable:false,
    disabled :true, //***I wan to disabled this check column in my grid for view only
    width: 25
});

colModel=new Ext.grid.ColumnModel([
    chkColH
]);


        xtype:'editorgrid',
        id:'theGrid',
        stripeRows:true,
        store:gridStore,
        colModel:colModel,
        trackMouseOver:false,
        columnLines:true,
        enableColumnMove:false,
        enableHdMenu:false,
        frame:true,
        disableSelection:true,
        plugins: [chkColH],
        sm:chkSM

Solution

  • You can override onMouseDown to do nothing in CheckColumn:

    var chkColH = new Ext.grid.CheckColumn({
        header: ' H',
        dataIndex: 'testing',
        resizable:false,
        width: 25,
        onMouseDown : function(e, t){}
    });