【问题标题】:How to clear/reload/refresh JQuery Async Treeview?如何清除/重新加载/刷新 JQuery Async Treeview?
【发布时间】:2010-06-24 15:42:34
【问题描述】:

我已经实现了 JQuery Async Treeview(在 APS.NET MVC2 中)并且工作正常,但问题是当用户将新节点添加到树中时(通过另一个接口),没有办法重新加载树并反映新的树结构。

查看树中更改的唯一方法是关闭浏览器 (IE8)。每次重新加载时在树上尝试 .empty() 没有任何作用:(

这是页面来源:

    <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>

只有在第一次构建树时才会调用 URL /OrganizationStructure/Browse。即使单击浏览器的“刷新/重新加载”按钮,我也无法重建它。

任何帮助将不胜感激。谢谢

【问题讨论】:

  • 你是不是偶然使用了OutputCache?
  • 我不知道 - 我如何检查/关闭它?

标签: jquery asynchronous treeview reload


【解决方案1】:

编辑: 惊喜——empty() 然后 treeview() on document ready 在 Chrome 和 FF 中都可以正常工作,但在 IE8 中不行:P

仍然迷失在这个...

是否可以在每次扩展节点时始终调用 url?一旦它已经加载,我不知道是什么阻止它

再次感谢

【讨论】:

    【解决方案2】:

    this answer找到答案:

    [OutputCache(NoStore = true, Duration = 0, VaryByParam = "None")]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-07
      • 1970-01-01
      • 2011-02-16
      • 2013-03-29
      • 1970-01-01
      • 2017-08-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多