HotColumn with setting type numeric is not working

Tags: #<Tag:0x00007efc709a2860>

Hi @aleksandra_budnik, I am trying to make one column as numeric in edit mode(should only accept numbers [int/float]).

  1. It does work when we implement it like this
    hot1 = new Handsontable(example1, {
    data: getCarData(),
    colHeaders: [‘Car’, ‘Year’, ‘Chassis color’, ‘Bumper color’],
    columns: [
    {type: ‘numeric’},
    ];

  2. But when I try the same as a setting in HotColumn, it doesn’t. Can you please assist. Here’s a sample - (have made column 3 as numeric)
    https://codesandbox.io/s/object-data-source-forked-6m0vh?file=/src/index.js

Hi @kishoranand.raj

the ScoreRenderer adds styling that doesn’t allow the cell to turn red (invalid). When cell (value of TD) is invalid it gets htInvalid className.

Hi @aleksandra_budnik, Yeah, I tried in column 1 which doesn’t have custom renderer and it worked. What to do in a case like this?

Hi @kishoranand.raj

Sorry, for the delay. I did not get a notification.
I will get back to you tomorrow with tips.

HI @aleksandra_budnik, yeah no problem.

Hi @kishoranand.raj

Here an example https://codesandbox.io/s/object-data-source-forked-90kh4
We needed to include information about the validity of the cell within the renderer. Without that information, the custom renderer overwrites the default cell renderer (in this case, the one added with the numeric cell type).

1 Like

Thanks @aleksandra_budnik, this is helpful.:+1: