cellGroups not completely removed when removing column?


I have a Grid which looks like this
, where I can add and delete columns dinamically.

When I select delete column 1, I want all columns below the header 1 to be removed. In order to do that I’m using this in a loop:

grid.removeColumn(propertyId); But when removing columns I get the following exception, thrown by Grid.sanityCheck():

java.lang.IllegalStateException: Not all merged cells were in a continuous range.

When debugging my code I see that this


returns [[2, 3, 4]
, [5, 6, 7, 8]
] before removing any columns, then, inside my loop, keys 5 and 6 are removed, but 7 and 8 are not. As I result I get the above exception…

I don’t understand why some of the keys are being removed and others aren’t… Actually if I debug deeper, in the Grid.internalRemoveColumn(), inside this remove method: getState().columnOrder.remove(columnKeys.key(propertyId)); it seems that the keys
get removed…!

Any help is much appreciated.

Did you ever figure this out?