[#5977] How to add checkbox in column header?

Tags: #<Tag:0x00007efc60efb470> #<Tag:0x00007efc60efb308>

Hi,

I’m trying to add checkbox in header, and I have followed this thread,

but I’m facing issue (Cannot read property ‘className’ of undefined), I have tried in this stackblitz example

but, Is there any other approach available to achieve this checkbox in header scenario.

Kindly help.

Hey @prabu.kuppusamy

even without any actions I get this error

40

I suggest you check that one first as it might be blocking some further scripts for executing.

Can you try the same stackblitz link again?
Now the getSourceData issue gone,
and I’m facing the same issue, when try to click the checkbox,

Please help.

I do not have good news. You’d need to give up the nestedHeaders as they are rewriting anything you put into colHeaders. And if you’d decide to use afterGetColHeader instead, the checkbox will be added to all the headers https://jsfiddle.net/AMBudnik/ah2euv0c/.
We have been reported a request to add a header renderer https://github.com/handsontable/handsontable/issues/5977, which would cover that case. I will update you once we add it.

1 Like