Our blazing fast Grid component built with pure JavaScript


Post by thejas.pateel »

Hi,
I have doubt is it possible to make read only fields depend upon checkbox selection as shown in screen shot.

CheckBox.jpg
CheckBox.jpg (3.38 KiB) Viewed 399 times

. I need N.A field to be read only when checkbox is checked


Post by marcio »

Hey thejas.pateel,

You can achieve that behavior like this

{
            type      : 'check',
            field     : 'allow',
            listeners : {
                toggle : ({ checked }) => {
                    grid.columns.get('name').editor = !checked;
                    grid.columns.get('name').readOnly = checked;
                }
            }
        }

https://www.bryntum.com/docs/grid/api/Grid/column/CheckColumn

Best regards,
Márcio


Post by thejas.pateel »

This will make read only for whole column ,my condition is when check box is checked in any row .text boxes for that particular row should be read only not all textboxses


Post by tasnim »

To disable editing on certain fields/columns on certain records the best thing would be to listen for beforeCellEditStart https://bryntum.com/docs/grid/api/Grid/feature/CellEdit#event-beforeCellEditStart
Inside of that you could return false if a condition is met


Post Reply