Hello,
What we want to achieve is to let the users move the columns with the headers as well.
And in the process we encountered an issue with max call stack exceed.
Thank you for the screens - I see what you would like to achieve.
What I did to test it is I took your demo Handsontable example - JSFiddle - Code Playground and changed headers variable from a single array to an array of arrays to get nested headers. But as I can see there’s a lot to do. Please take a look.
Basically nestedHeaders is a new feature and we have some tasks to accomplish as well - to make it more flexible when it comes to moving. In our current behavior (source: Handsontable example - JSFiddle - Code Playground) we move only data inside the table while headers are stable.
Presented feature will be definitely something great, without any doubts, however, will present structure it will be hard to even create a working workaround.
here you can see that it is working perfectly before you reinit the table, as soon as you reinit the table and move columns it goes through max call stack size
This demo is great! Have you tried to use updateSettings to reset values instead of destroying the instance? I think that I saw an issue related to destroy method.
I have shown your demo to our devs and they all said that this is amazing. We would be more than happy to see a similar solution in the official version of Handsontable.
ps. I have tested it more and when you move the country column inside Channel you get something like that
Hello @aleksandra_budnik, yes that is a desired behavior as column headers C D E F G belong to Entity(Parent) Channel and Sign Date and Country are separate Entities.
So whenever you move, the table always shows the relation between Parent - Child
Ohh I see. This actually makes sense and it’s even cooler that you have created a fully functional feature.I become really curious about your implementation of Handsontable. Is there any possibility to see it online?
@aleksandra_budnik sure, we also though, if you guys would like, we could arrange a demo.
Please write us an email so we can arrange it or you can visit our product, datapine.com
Back to the topic.
We have fixed the issue we are currently having with nested headers.
The problem we found is the way the plugin works, with predefined arranged columns manual movement.
If the plugin has a predefined sorted columns order when initializing, on each updateSettings it tries to move the columns by the initial order even tho we move the columns in a different order.
The solution for now is to initialize/re-initialize with no order, and set the column mapper to our previous saved positions on the plugin initialize.
Then handsontable behaves correctly.
Here is a full working example: http://jsfiddle.net/Resems/7zjzg5pd/10 .
But now we have a different issue, in the provided example above, the beforeInit is never called.
As far as looking into the code and plugin itself, it rewrites the callback and never calls it.
Is there any way to fix this ?