Hi,
I noticed a strange behavior: when I drop a node onto another node which has no children and is loaded on demand by a webserivce, I will have the dropped node twice.
This is what I do
- expand node A by clicking the expand icon
- node A expands and has no children (using LoadOnDemand - webservice)
- I drag node B over node A
- The change of the parent is saved in database using a webservice
- After saving, I move node B client-side in javascript from the old parent to the new parent (node A)
- node B is visible under his new parent node A
- when I collapse node A and expand it again (by using the expand icon), I see the new node twice (the first was my moving in javascript the duplicate is fetched by webservice)
If node A would has at least one child when it is expanded the first time, everything is fine.
This only occurs if the new parent node had no children before the drag&drop operation.
How can I prevent that behavior?
Edit: What currently works for me is to clear the current node's children on the OnClientNodePopulatingHandler:
Is there a better way to achieve this?
I noticed a strange behavior: when I drop a node onto another node which has no children and is loaded on demand by a webserivce, I will have the dropped node twice.
This is what I do
- expand node A by clicking the expand icon
- node A expands and has no children (using LoadOnDemand - webservice)
- I drag node B over node A
- The change of the parent is saved in database using a webservice
- After saving, I move node B client-side in javascript from the old parent to the new parent (node A)
- node B is visible under his new parent node A
- when I collapse node A and expand it again (by using the expand icon), I see the new node twice (the first was my moving in javascript the duplicate is fetched by webservice)
If node A would has at least one child when it is expanded the first time, everything is fine.
This only occurs if the new parent node had no children before the drag&drop operation.
How can I prevent that behavior?
Edit: What currently works for me is to clear the current node's children on the OnClientNodePopulatingHandler:
function OnClientNodePopulatingHandler(sender, e) {
e.get_node().get_nodes().clear();
}
Is there a better way to achieve this?