0

I've implemented the JQuery Async Treeview (in APS.NET MVC2) and it works fine, but the problem is when the user adds new nodes to a tree (via another interface), there is no way to reload the tree and reflect the new tree structure.

The only way to see the changes in the tree is to shut down the browser (IE8). Trying .empty() on the tree on every reload doesnt do anything :(

Heres the page source:

    <script src="/Scripts/jquery.treeview.js" type="text/javascript"></script>
<script src="/Scripts/jquery.treeview.async.js" type="text/javascript"></script>   
<script type="text/javascript">
    $(document).ready(function() {           
        $('#organizationStructure').empty();
        $('#organizationStructure').treeview({
            url: '/OrganizationStructure/Browse/',
            collapsed: true,
            animated: "medium",
            control: "#sidetreecontrol"
        });
    });
</script>

<h2><%= Html.Encode(ViewData["Message"]) %></h2>  
<p></p>
<div id="sidetreecontrol"> <a href="?#">Collapse All</a> | <a href="?#">Expand All</a> </div> 
<p></p>    


<ul id="organizationStructure" class="filetree"></ul>

the URL /OrganizationStructure/Browse is only called when the tree is being built the first time..i cant for the life of me get it to rebuild even when the browsers "Refresh/Reload" button is clicked.

Any help would be GREATLY appreciated. Thanks

Jerrold
  • 1,434
  • 6
  • 24
  • 43

2 Answers2

0

EDIT: Surprise surprise - empty() then treeview() on document ready works fine in both Chrome and FF, but not IE8 :P

Still lost on this one...

is it possible to ALWAYS call the url everytime a node is expanded? I have no idea whats stopping it once its already loaded

Thanks again

Jerrold
  • 1,434
  • 6
  • 24
  • 43
0

Found the answer in this answer:

[OutputCache(NoStore = true, Duration = 0, VaryByParam = "None")]
Community
  • 1
  • 1
Jerrold
  • 1,434
  • 6
  • 24
  • 43