#10018 closed defect (fixed)
ForestStore's root label turns to "undefined" after deleting a tree node
Reported by: | Jean-Rubin Leonard | Owned by: | Kris Zyp |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | DojoX Data | Version: | 1.3.2 |
Keywords: | tree forestStoreModel JSONRestStore undefined delete | Cc: | jrleonard@… |
Blocked By: | Blocking: |
Description
When I delete a tree node, the forest store's root label turns from whatever it was to "undefined". This doesn't happen consistently but only for some treenodes although the treenodes are not fundamentally different from one another. I have attached a test case with which includes the tree, data and delete code with which i was able to reproduce the issue. If you delete any node node under "scenario 2" you should be able to reproduce the issue. I have filed this bug under the dojox component as I think the issue is within JSONRestStore. After some initial debugging I have narrowed down the issue to the store's deleteItem method's fixReferences anonymous function. I wasnt able to get any further as I could not decipher the logic of this function.
Attachments (3)
Change History (12)
Changed 10 years ago by
comment:1 Changed 10 years ago by
Owner: | changed from Adam Peller to Kris Zyp |
---|
comment:2 Changed 10 years ago by
Hmm I tried this test but had a number of problems. First of all, it didn't display at all (on FF3.5/mac). I added
html, body { height: 100%; margin: 0; padding: 0; }
That made it display alright. Although, the BorderContainer, AccordionContainer, ContentPane etc. all seem irrelevant to this test.
The biggest issue though is that when I used the drop down button to select "delete" nothing happened.
Changed 10 years ago by
Attachment: | 10018_v2.zip added |
---|
comment:3 Changed 10 years ago by
I didnt attach the css so the display was screwed up. As for the button code not executing I wouldn't understand why that would so. Anyhow I have made a more complete and self contained test case. I am on FF 3.5.3 on a mac so it should work. Let me know. JR
comment:4 Changed 10 years ago by
Well, it does work. I select "Simulation 1", then do "delete" from the menu. Nothing bad happens. The top of the tree is still "New Company". Works for me on trunk and 1.3.
comment:5 Changed 10 years ago by
If you choose any node under scenario 2 and try to do the same thing you will reproduce the issue. I reproduce on trunk as well. JR
comment:6 Changed 10 years ago by
Component: | Dojox → DojoX Data |
---|
OIC, yah apparently a store problem, as you said, a problem with fixReferences()... after deleting a node JsonRestStore tries to update parent node(s) to remove references to the deleted child... and for some reason onSet(item) is getting called where item is an array of items rather than a single item.
comment:7 Changed 10 years ago by
As I tried to to debug this ticket, I made some changes to the test file. When i set up the lazy loading children, I now include their node name after the $ref. I wasn't doing this and tought it might be what was causing the issue but this is not the case. As additional information I now receive a "labelNode is undefined" when I 1) delete a node 2) click on any other node of the tree. This second error happens anytime we delete a node in the test file. Before that we can select any node in the tree without any problem. I hope this helps in guiding for debugging.
Changed 10 years ago by
Attachment: | 10018 V3.zip added |
---|
comment:8 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:9 Changed 10 years ago by
Milestone: | tbd → 1.4 |
---|
js and data file to help reproduce issue