Make specific cell read-only

Help.

Requirement
When the “Active” option under the Employee select box is displayed, the resigned date blank cell next to it must be read-only. For other options, the resigned date cell my be editable.

Problem
I tried to use updateSettings on the HOT instance using the afterInit method, but the registerer returns undefined. And due to this I am not able to make the resigned date cell read-only when ever the Active status is displayed on table render.

Can you suggest what’s wrong? @aleksandra_budnik

Link: JS Bin - Collaborative JavaScript Debugging

Hi @m.saad.yaseen

I suggest to add the logic to afterRender hook (used with once so it won’t produce an infinite loop) and just call the setCellMeta(row, col, readOnly, true). You shouldn’t need updateSettings. Of course then push the same meta to the afterChange hook if a user can edit data.

1 Like

Thanks for the suggestion. I’ll experiment, and let you know.

1 Like

I used this with the cells function. Thanks.

1 Like

Great. Happy to help.

1 Like