How to validate columns

Tags: #<Tag:0x00007f452e02c130>

hi,
I’m working to the validation of columns in angular. In my code I used hot-column in html and the validation didn’t work. How to validate a cell is required/mandatory on load and on Save?

see below image I added hot-column and the validation didn’t work.

my code:

Hey @balagtasalbert05

Can you send me over a demo? The use of the hot-column should not change anything in that case. Here’s an example https://jsfiddle.net/yjp2L6dg/2/ I do not see afterInit hook in that snapshot.

what I’m trying is to make column required. I think having hot-column it doesn’t work the allowEmpty.
columns: [

    {

      type: 'numeric',

      allowEmpty: false,

    }

  ],

with hot-column: allowEmpty doesn’t work
image

without hot-column: allowEmpty work

my code:

Hi @balagtasalbert05

Here https://jsfiddle.net/gav56e18/7/ is an updated demo.
It works well when you add allowEmpty to the hotColumn. But it does not in other scenarios. I will investigate the subject and report it to our Github board. At the same time, I hope that declaring the same as in my demo would work for you.

hi @aleksandra_budnik
yes it works for me but if I change the type to text the allowEmpty is not working.

The text cell type (as the only cell type besides handsontable type) does not have a cell validator so the allowEmpty is not checked.

so how can i validate the type is text to make it required fields?

The text cell type does not own a dedicated validator by default. But if you have a set scope of rules for a cell you can attach a custom validator. Here is an example https://jsfiddle.net/0m9135h8/2/

Hi @balagtasalbert05

Can we call this issue solved?