【问题标题】:Add buttons to Bootstrap Treeview Node将按钮添加到 Bootstrap Treeview 节点
【发布时间】:2016-04-04 08:20:54
【问题描述】:

我有一个引导树视图,它有两个级别。而且我需要在树视图的不同节点上添加不同的按钮。

这是我的结构

var tree = [
  {
    text: "Parent 1",
    nodes: [
      {
        text: "Child 1",
        nodes: [
          {
            text: "Grandchild 1"
          },
          {
            text: "Grandchild 2"
          }
        ]
      },
      {
        text: "Child 2"
      }
    ]
  }

];

我需要在每个子节点(这里是子节点 1 和子节点 2)上显示一个按钮作为“上传”,并且需要在孙子级别中添加两个名为“删除”和“下载”的按钮。

在引导树视图中是否有像剑道树视图这样的节点模板?

【问题讨论】:

    标签: javascript twitter-bootstrap twitter-bootstrap-3 treeview kendo-treeview


    【解决方案1】:

    按照上面的方法

     var btnid = 'btnEdit_node_' yourrecordid;
        var button = " <div/><button type='button'  id='btnEdit_" + data.id + "'  class='btn btn-primary' onclick='exxecutefunction()'>" +
            "<i class='glyphicon glyphicon-edit'></i> Edit" +
            "</button>";
    
        var node = {};
        node.text = data.description + button;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-20
      • 1970-01-01
      • 2013-07-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-16
      相关资源
      最近更新 更多