Page 1 of 1

[VUE 2]

Posted: Tue Nov 08, 2022 3:48 pm
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 451 times

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


Re: [VUE 2]

Posted: Tue Nov 08, 2022 7:58 pm
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


Re: [VUE 2]

Posted: Wed Nov 09, 2022 10:32 am
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


Re: [VUE 2]

Posted: Wed Nov 09, 2022 12:32 pm
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