I have two tree’s; One on the left that acts a master set of items and a tree on the right that
allows the user to specify their items by drag n drop. The user will drag items from the
left master set of items to the right tree thereby creating their user specific items.
I.e. Master items on the left:
- Software (first level item)
- Windows Software (second level item) (Parent id is 1)
- Hardware (first level item)
- Video cards (second level item) (Parent id is 2)
I.e. User specific items on the right:
- there are no items on the right by default. the user has to click on a button to add an initial tree item.
Next the user adds an item to the tree. I.e. Paper
Next the user drags Software(which includes Windows tree Item) to the right and also drags Hardware tree item from
the left to the right(which includes Video Cards tree item)
- Software (first level item) - these are dragged from the left master items
- Windows Software (second level item) - these are dragged from the left master items
- Hardware (first level item) - these are dragged from the left master items
- Video cards (second level item) - these are dragged from the left master items
The issue that is occuring is that when the dataProcessor for the tree on the right saves the
new items, they are coming back with the parentId from the master items, and not the actual
Parent ID the items on the right will have once inserted into the database.
For example if you drag windows item from the left to the right, it’s parentId will be 1, but when Software was
dragged to the right it’s primary key id was 5 so now any items added to Software should have a parent Id of 5.
How would I achieve doing this?
My thoughts are that on after drag I could update the tree items on the right parent id value and then call the dataprocessor sendData which would save the data and save the correct parentid for items.
The problem confirmed and fixed, please contact us directly at email@example.com if you need a fixed version of dataprocessor ASAP.
( Fixed version sends data about child items only after parent items saved, so they will use new parentId values )