I’m trying to add a 2 row header via nestedHeaders.
I would like the default headers for the first row (i.e., A, B, C, D, …) and blank for the second row. Is there a way to force handsontable instance to use the default header values? or a function to get a string given a minCols?
the colHeaders helper attaches the A, B, C… values to headers but here https://jsfiddle.net/mor6L8cp/ I’ve made an example that returns filled and empty headers.
When I use getColHeader() it doesn’t return all the levels, it only returns the single level header of something else? In your example, it seems to be printing out something completely different? You have two print statements in someFunction and the afterRender is a different length and null? Am I missing something?
I found this from the github issues hot.getSettings().nestedHeaders
is this the preferred method?
That’s right. Sorry, I was printing the method array, not the getColHeader.
Yes, the getSettings().nestedHeaders is the right one. In the example we just need to pass the same parameter to someFunction2 as it was for someFunction. Cause without it your null array will contain only 10 elements. Updated demo Handsontable example - JSFiddle - Code Playground
Thanks. Is there a way to force the nested headers to resize to the appropriate width, I notice if I update the nested headers then the column widths become extremely small?
I’m in a middle of a conversation with my colleague. However, I do not see full support for ‘undefined’ value for nestedHeaders. It also results in a situation when provided data is cut.
We have checked the way those columns are calculated and the mechanism itself is correct. However, to get the same effect as with the colWidths we’d need to expand those columns with content.