sridhars711 / dynatree

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

Persistance is broken #84

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open file:///C:/Prj/eclipse-ws/dynatree/doc/sample-persist.html
2. Select, activate, expand some nodes
3. Hit [F5]

--> Status is NOT persisted

Version 0.4.0

Original issue reported on code.google.com by moo...@wwwendt.de on 14 Mar 2009 at 5:55

GoogleCodeExporter commented 9 years ago
Seems to be rather a problem with caching of frames.

Original comment by moo...@wwwendt.de on 23 Mar 2009 at 4:02

GoogleCodeExporter commented 9 years ago
Mail from a user:
[...]
This example for show you my problem:

List of index.html:
-------------------
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <title>TEST</title>
        <script src='./jquery/jquery.js' type='text/javascript'></script>
        <script src='./jquery/ui.core.js' type='text/javascript'></script>
        <script src='./jquery/jquery.cookie.js' type='text/javascript'></script>
        <script src='./src/jquery.dynatree.js' type='text/javascript'></script>
        <script src='./src/mytree.js' type='text/javascript'></script>
        <link href='./src/skin/ui.dynatree.css' rel='stylesheet' type='text/css'>
    </head>
    <body>
        <div id="tree"> </div>
    </body>
</html>
-------------------

List of mytree.js:
-------------------
$(function(){
  $("#tree").dynatree({
    title: "tree root",
    rootVisible: true,
    persist: true,
    children: [
      {title: "Dir - 2", isFolder: true, key: "1",
      children: [
        {title: "Dir - 2.1", isFolder: true, key: "2", children: [{title:"File -
2.1.1", key: "211"}]},
        {title:"File - 2.1", key: "21"},
        {title:"File - 2.2", key: "22"},
        {title:"File - 2.3", key: "23"}
        ]}
      ]
  });
});
-------------------

If click on Dir-2 after refresh page I have Dir-2 selected but not expanded, if 
I
press F5 again, Dir-2 selecting and expanding. If  refresh page again so Dir-2
selected but not expanded... And this continue more time.
In cookies writing variables: ui-dynatree-cookie-active, 
ui-dynatree-cookie-expand.
In cookies "ui-dynatree-cookie-active" contain value key of Dir-1, and in
"ui-dynatree-cookie-expand" or empty or contain value key of Dir-1, after every
refresh value of "ui-dynatree-cookie-expand" changed on 1 or empty.

Next click on Dir-2.1 cookies ui-dynatree-cookie-active, 
ui-dynatree-cookie-expand
destroyed.

If  I replace dynatree.jquery 0.40.to dynatree.jquery 0.30 all are working.

Original comment by moo...@wwwendt.de on 25 Mar 2009 at 6:40

GoogleCodeExporter commented 9 years ago

Original comment by moo...@wwwendt.de on 25 Mar 2009 at 6:42

GoogleCodeExporter commented 9 years ago
Reproducible:
http://wwwendt.de/tech/dynatree/doc/sample-persist.html

Activate the folder and [F5] toggles expansion

Original comment by moo...@wwwendt.de on 25 Mar 2009 at 6:56

GoogleCodeExporter commented 9 years ago
One part of the problem was caused by an unexpected behaviour of the $.cookie 
plugin.
http://plugins.jquery.com/node/7579
This is fixed with r212

Original comment by moo...@wwwendt.de on 14 Apr 2009 at 10:23

GoogleCodeExporter commented 9 years ago
The other part is caused by the current implementation of persistance:
since all events are re-fired after reloading, an active folder get's an 
'expand'
event (expanding it) and another 'activate' event, that will collapse it again, 
if
clickfolderMode=3.

This is a bit more work: issue 91

Original comment by moo...@wwwendt.de on 19 Apr 2009 at 5:50

GoogleCodeExporter commented 9 years ago
Closing this, so 0.4.2 can be released.
issue 91 should improve this further, but might cause some migration.

Original comment by moo...@wwwendt.de on 19 Apr 2009 at 5:56

GoogleCodeExporter commented 9 years ago
considered verified

Original comment by moo...@wwwendt.de on 17 Jul 2012 at 4:12