Empty cells validator when adding a new row

Tags: #<Tag:0x00007efc60a139f8> #<Tag:0x00007efc60a138b8>

Hello!

I have the following scenario:

User inserts a new row (from the context menu). The first 4 cells are mandatory, so the afterChange should not trigger the save if they are empty. Also the htInvalid css should be applied automatically on those 4 cells when adding a new row.

How can I achieve that?

I should mention I am using nestedHeaders, so I cannot add validators on the columns in this setup, like in some jsFiddles i have seen around. Maybe that is possible, but I don’t know how to do it.

I am very confused on how to use validators basically. Is there such an example with validators added on new rows, but only for some of the cells, not all?
Or do you have any other suggestions?

Thank you!

Hi @vitorialipan

I think in this scenario you might need to use afterCreateRow hook and then inside it update the settings with with the validator declared on required cells using updateSettings and cells option. Below I attach the links to mentioned options.

Hello,

Thank you, after reading your reply and further investigating custom validators, i finally managed to do it!

You can close this topic. Have a great day!

@vitorialipan

This is great news! Thank you for the update.