I am using Ag Grid to show unstructured tabular data. As data is not structured so, I have to create Column Header programmatically.
Here is complete demo on how I am doing it. https://stackblitz.com/edit/react-ts-oy93nr
you can check final output here. https://react-ts-oy93nr.stackblitz.io
Here, if you can see there is group for single item (child of group or item that might be without group) as well or I can say that last item is also becomes the group. Which is incorrect behavior for my use case. Last item/s should not become group but should stay part of group.
That behavior can be achieved if I replace ln#121 return r[i] || null; with return r.slice(0, r.length -1) || null; . This option will take group to one level up. But here issue is that it will push all groups to below and single item to top. Means it rearranges row order to incorrect position.
I am new to Ag Grid so any help or direction would be really helpful. Do let me know if any further details are required.
Also, it is OK if solution required Ag Grid Enterprise edition as it is already being used.