Mehaboob Khan
Mehaboob Khan

Reputation: 353

How to change value of "disableSelection" of a grid in Ext js 4.0 dynamically?

I have the grid coded in Ext js 4.0. Below is the code:

    var xxx=Ext.create('Ext.grid.GridPanel', {
                    title: 'tableId',
                    id : 'tableId',
                    disableSelection:true,

                    //remaining code

            }

I want to change the value of "disableSelection" dynamically outside the grid according to two different conditions.

How can I do this?

Upvotes: 0

Views: 815

Answers (1)

Zero Cool
Zero Cool

Reputation: 1936

If you're wanting to disable selection of the grid rows (such as in a checkbox selection model) you can use:

xxx.getSelectionModel().setLocked(true);

To enable selection just use the reverse:

xxx.getSelectionModel().setLocked(false);

Please see this fiddle for an example: https://fiddle.sencha.com/#fiddle/nf8

Upvotes: 2

Related Questions