OdinaSpb / jstree

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

Refresh does not always work #838

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a tree with a root folder and a subfolder or two fed by JSON
2. Use some method to create a new folder in the database (not the add folder 
method inside jstree).
3. Use $('#treediv').jstree( "refresh", -1 ) to refresh the tree whenever a new 
folder is created.  Note that the -1 does not seem to make a difference, can 
also be called without it.

What is the expected output? What do you see instead?

When an empty subfolder (call it A) of the root is selected and a new folder 
(call it Sub) is created in A, the refresh doesn't do anything, there is not 
even an AJAX request that goes out.  If you do a browser refresh, Sub then 
shows up in the tree.  Now that the A folder has children, if you create 
another subfolder, say Sub2, the tree will refresh properly.

Additionally, if you create a subfolder of Sub1, say SubSub1, the refresh will 
work.

Start over and assume there is only root and its children. No refresh will 
occur if a subfolder of root is created.  

If we change the situation so that at least one of root's children also has its 
own children, the tree will at least attempt a refresh.  Unlike the others, 
this refresh does not work though, the new root child will not appear in the 
tree until a browser refresh occurs.

Even stranger.  Start over with a root and subfolder A.  Go to A, create 
subfolder in it called Sub1. As stated above, tree will not refresh.  Do a 
browser refresh to get everything to show up.  Now, create subfolder of root 
called B.  Again, in a non-refresh situation so no visible change occurs, but 
it is definitely in the database.  Go to A, create subfolder Sub2.  As stated 
above, the tree refresh will happen but only the A subtree will be properly 
updated, B will not show up under root. 

Based on the json coming back from the last two paragraphs, it looks like 
jstree is only requesting A's subtree, rather than the whole tree starting at 
root.

What version of the product are you using? On what browser?

r232, Firefox 3.6.12

Original issue reported on code.google.com by akspamcatcher@gmail.com on 7 Dec 2010 at 5:31

GoogleCodeExporter commented 9 years ago
I just applied a few fixes for that and will commit in a few minutes, if that 
does not work, could you please share your config so that I can reproduce.

Kindest regards,
Ivan

Original comment by ivan.bozhanov on 8 Dec 2010 at 11:13

GoogleCodeExporter commented 9 years ago
Still not working from me, at least based on a checkout from the svn today.  If 
you need more info or code from me or would like a faster discussion mechanism, 
if you go to the website listed in my profile you can find an e-mail address to 
contact me directly.  Thanks Ivan!

Original comment by akspamcatcher@gmail.com on 10 Dec 2010 at 5:43

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by ivan.bozhanov on 12 Jan 2011 at 6:21