Automatic clean-up to ensure relationship integrity.
Automatic clean-up to ensure relationship integrity.

In the event any relationships are out of sync caused by moving a row which now leaves a gap between parent and child the clean-up will scan through the table rectifying these problems.
Governed by the option cleanUpRelationships to enable or disable the functionality.
The first record can't have another parent so it gets reset to level 0.
Since the only problems that can occur is when there is a gap (1 or more levels) between the parent and child clean-up will only run if hierarchy level is more than one to start.
Running throug the list of rows if a row is at a level more than parent level + 1 keep removing levels until it is not.

ilovezy/TableDnD,ilovezy/TableDnD,ilovezy/TableDnD