[#8683] HotColumn

Tags: #<Tag:0x00007f8b243f54b0> #<Tag:0x00007f8b243f52d0>

Hi, I have a problem with the validation in custom columns of the HotColumn component. As you can see in the image, I have two types of columns some with only HotColumn and others with custom components. In the custom one I don’t get the red background, if the validation is not valid.
Is it possible that my component ColumnEdges can inherit all the properties of HotColumn to do this? or is there any alternative?


image

Thanks

Hi @gvargash2

Can you share the code of the validator?

1 Like

@aleksandra_budnik

This is my validation function validateEdges

if the codes, from the CUSTOM HOTCOLUMN column, is not in that list it should be invalid. From what I understand the validation is fine. My question is how can I apply the HotColum arguments to my custom component?
image
image

Here is an example of how the validation works in a HotColumn and not in another one with a custom HotColumn.

https://codesandbox.io/embed/object-data-source-forked-1qrg9?fontsize=14&hidenavigation=1&theme=dark

Thank you, I will look into it and update you after the weekend.

Hi @gvargash2,
Custom renderers do not follow the same path of TD’s element decoration as the built-in renderers. To do that, you should use at least BaseRenderer to apply invalidClassName. See the following example: https://codesandbox.io/s/custom-hotcolum-validator-forked-knt8z?file=/src/renderers.jsx.

1 Like

Thanks @piotr.laszczkowski, all well up to this point. However, when verifying the validations with the validateCells function, the values of the cell with the custom column are deleted. How can I keep the values?
https://codesandbox.io/s/custom-hotcolum-validator-forked-ivnh6?file=/src/index.js

Hi @gvargash2,
Unfortunately, there is an issue related to invoking validators internally in Handsontable. I reported it on our official issue-board: https://github.com/handsontable/handsontable/issues/8683.
Thank you for your involvement.

1 Like