【问题标题】:Not able to see folder name in jstree. Only icon is shown无法在 jstree 中看到文件夹名称。仅显示图标
【发布时间】:2017-01-04 07:48:57
【问题描述】:
 function abc() {
     var legend = [{
       "test": "adbc.tiff"
     }, {
       "test": "CD.tiff"
     }, {
       "test": "sec_color"
     }];

     $("#local_tree").jstree({

       'core': {
         'data': [{
           "text": "Tiff Files",
           "children": legend
         }]
       },
       "checkbox": {
         "keep_selected_style": false
       },
       "plugins": ["checkbox"]
     });
}

我不知道为什么我只能看到一个图标而不是像“adbc.tiff”这样的文件名。 'CD.tiff 3' 文件夹可见但名称不可见。

【问题讨论】:

    标签: javascript html jstree


    【解决方案1】:

    定义要显示的字符串的属性是text,而不是test。

    // use text: "...", not test: "..."
    var legend = [{
       "text": "adbc.tiff"
     }, {
       "text": "CD.tiff"
     }, {
       "text": "sec_color"
     }];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多