How to restrict the minimum width of columns when manually resizing it

So, I want to restrict the minimum column width that a user can give to columns manually. how can i achieve this?

Hi @abhay.gupta

Currently there is no other way that to call updateSettings() method to alter widths within afterColumnResize hook.

I tried beforeColumnResize to return false and modifyColWidth to return a new width. But currently it is not supported. I will investigate the subject further, as modifyColWidth approach worked in the past, and I will update you with any news.

can you check the above demo and let me know what am I doing wrong as I am not able to restrict the column width.

I recommend moving the hotInstance check to the IF condition as it may cause console errors. When we do that like this

we can see that the method for the setTimeout() with the change to colWidths does not run if the new size is smaller than 120 pixels.

Hi, I tried it another way, is this a good alternative approach? Refer this link:

@aleksandra_budnik can you please take a look at this?

Hi @abhay.gupta

Sorry for the delay. The solution seems be correct. When we reszie the first columns it is blocked on the minima, value of 120 and it happens

(it’s 118px for the columns + 1px per side for the border).