打开下一级节点的滑块

时间:2019-08-14 07:18:22

标签: treeview nodes

我有一个页面,上面有节点。

(树状视图)

现在我想有一个滑块来控制要折叠或扩展的节点级别。

enter image description here

当前代码为:

<asp:Button id="ExpandButton" 
    CommandName="Expand"
    Text="Expand All Nodes"
    OnCommand="Button_Command"
    runat="server"/> 
  <asp:Button id="CollapseButton" 
    CommandName="Collapse"
    Text="Collapse All Nodes"
    OnCommand="Button_Command"
    runat="server"/>

顶部的javascript部分是:

  <script runat="server">
  void Button_Command(Object sender, CommandEventArgs e)
  {
    switch(e.CommandName)
    {
      case "Expand":
        tvSettings.ExpandAll();
        break;
      case "Collapse":
        tvSettings.CollapseAll();
        break;
      default:
        // Do nothing.
        break;
    }
  }
</script>

效果很好,但是折叠了每个缩进节点。

0 个答案:

没有答案