樹控件--bootstrap treeview

最近在做arcgis api for javascript的開發,需要一個圖層樹控件,綜合比較了zTree和bootstrap的treeview,發現treeview還是更加方便,裏面有一個很重要的優點就是tags屬性可以直接寫html,這個在官網的api中沒有寫出來。

官網api:http://www.htmleaf.com/jQuery/Menu-Navigation/201502141379.html

        var defaultData = [
          {
            text: 'Parent 1',
            href: '#parent1',
            tags: ['<a>clickMe</a>'],
            nodes: [
              {
                text: 'Child 1',
                href: '#child1',
                tags: ['2'],
                nodes: [
                  {
                    text: 'Grandchild 1',
                    href: '#grandchild1',
                    tags: ['0']
                  },
                  {
                    text: 'Grandchild 2',
                    href: '#grandchild2',
                    tags: ['0']
                  }
                ]
              },
              {
                text: 'Child 2',
                href: '#child2',
                tags: ['0']
              }
            ]
          }]


具體樣例請見附件

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章