如何在bootstrap treeview中选择节点时添加事件

时间:2017-05-29 10:09:20

标签: treeview

var addButton = " <div style='position:absolute;'/><button style='width: 17px;height: 17px;padding-left: 0px;padding-right: 0px;padding-bottom: 0px;  padding-top: 0px;' type='button'  id='btnEdit_" + "heelo" + "'  class='btn btn-primary' onclick='executefunction1()'>" +
       "<i class='fa fa-plus'></i>" +
       "</button>";

       var editButton = " <div style='position:absolute;'/><button style='width: 17px;height: 17px;padding-left: 0px;padding-right: 0px;padding-bottom: 0px;  padding-top: 0px;' type='button'  id='btnEdit_" + "heelo" + "'  class='btn btn-primary' onclick='executefunction2()'>" +
          "<i class='fa fa-edit'></i>" +
          "</button>";


    var tree = [
  {
    text: "Would you like to take the survey?"+editButton,
    level : "1",
    nodes: [
      {
        text: "Yes"+addButton,
        option : "1",
        nodes: [
          {
            text: "How will you rate us ?",
            level : "1.1",
            nodes: [
              {
                text: "2",
                option : "1",
                nodes: [
                  {
                    text: "Will you recommend our product to your friend?",
                    level : "1.1.1",
                    nodes: [
                      {
                        text: "Yes",
                        option : "1",
                        nodes: [
                          {
                            text: "Do you want to subscribe to our youtube page?",
                            level : "1.1.1.1",
                            nodes: [
                              {
                                text: "Yes",
                                option : "1",
                              },
                              {
                                text: "No",
                                option : "2",
                              }
                            ]
                          }
                        ]
                      },
                      {
                        text: "No",
                        option : "2",
                      },
                    ]
                  }
                ]
              },
              {
                text: "1",

              }
            ]

          }
        ]
      },
      {
        text: "No",
        option : "2",
      }
    ]
  }
];

0 个答案:

没有答案