Letractively / dynatree

Automatically exported from code.google.com/p/dynatree
0 stars 0 forks source link

toDict() shouldn't export root node #379

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
exporting a tree with toDict() includes a root node (title:null, key:_1) that 
makes the resulting object not compatible to be loaded back with dynatree.

The default behavior should be the one that is currently obtained by doing 
toDict().children (or at the very least this caveat should be mentioned in the 
documentation, at http://wwwendt.de/tech/dynatree/doc/dynatree-doc.html#h8.4.8)

Alternatively (and perhaps a better choice, though not as straightforward to 
implement) loading the tree from json data should recognize this root node and 
not make it a child node of the tree, but instead apply its properties to the 
tree (e.g. title, id...)

Original issue reported on code.google.com by waldir.pimenta on 19 Nov 2012 at 2:17

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 20 Nov 2012 at 8:44

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 10 Feb 2013 at 8:42

GoogleCodeExporter commented 8 years ago
1.2.4 was a hotfix

Original comment by moo...@wwwendt.de on 12 Feb 2013 at 9:01

GoogleCodeExporter commented 8 years ago
Thank you Waldir took me forever to figure out how to solve this until I read 
your post

Original comment by Ghoff...@gmail.com on 7 Sep 2013 at 10:12

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r674.

Original comment by moo...@wwwendt.de on 8 Sep 2013 at 5:57

GoogleCodeExporter commented 8 years ago
yay \o/

Original comment by waldir.pimenta on 8 Sep 2013 at 10:52

GoogleCodeExporter commented 8 years ago
I think this is great, but you should note in the Changelog that this causes 
1.2.5 not to be BC.

I.e. if I call toDict() I will get the new behaviour instead of todays 
behaviour.

Original comment by tar...@frisvoldprivatgymnas.no on 31 Oct 2013 at 10:56

GoogleCodeExporter commented 8 years ago
Strong agree with #7. I looked at the ChangeLog, but did not know there was a 
breaking behavior change. Had to restore some data when I ran this the first 
time and inadvertently deleted root node relationships in the database.

Original comment by Lor...@gmail.com on 1 Nov 2013 at 3:41

GoogleCodeExporter commented 8 years ago
Sorry to hear that the change caused you problems.
I edited the project page and change log to make this hopefully more clear.

Original comment by moo...@wwwendt.de on 2 Nov 2013 at 7:13

GoogleCodeExporter commented 8 years ago
Thanks. It was relatively minor, just didn't think upgrading a JS library would 
take down QA for half an hour. Guess that's why the system is there.

Original comment by Lor...@gmail.com on 4 Nov 2013 at 6:40