Knowing all Invalid cells in handsontable

Tags: #<Tag:0x00007f453318d2b8>

Hello, I have to implement a save button and it is disabled when there is atleast one invalid cell present in handsontable and enabled when all data present valid in handsontable.Could you pls provide me a demo in React for that?

Hi @siddhantjain15298

To construct your condition you should use the following method

as mentioned in the docs

hot.validateCells((valid) => {
  if (valid) {
    // ... code for validated cells

is the only condition you need (+ else to make your button deactivated).

Thank you so much @aleksandra_budnik for help.I am exactly looking something like this
Can i ask one more Question :- "If i want to add both colHeaders like A,B,C,D…etc and a my custom column header like [‘ID’, ‘FirstName’, ‘LastName’] like that is it Possible in handsontable??

And then what should be the end result? Something like this?

[‘ID’, ‘FirstName’, ‘LastName’, ‘D’, ‘E’…]

i want to achieve something like that is there any possible way?

Maybe something like this

@aleksandra_budnik But What if column length is greater than 26 it will fail ?

I was going to ask if you need more :slight_smile:
Well, we use this helper to generate a single header label. So you can use it to create an n-length array for your nestedHeaders


let ht = Handsontable.helper.spreadsheetColumnLabel(0);
// result `A`
let ht = Handsontable.helper.spreadsheetColumnLabel(60);
// result `BI`

Thanks @aleksandra_budnik Got the logic i created an array with Label ‘A’,‘B’,‘C’,…etc. in nested headers

I’m glad to hear that everything is working well. Let me know if you would need anything else.

Hi @aleksandra_budnik I need a help regarding nested Headers when i pass empty data prop in handsontable table nested Header does not appear in table view why is that?