Not able to see folder name in jstree. Only icon is shown

361 Views Asked by At
 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"]
     });
}

I don't know why I'm only able to see an icon and not a file name like 'adbc.tiff'. 'CD.tiff 3' folder is visible but name is not.

1

There are 1 best solutions below

0
On BEST ANSWER

The property that defines the string to be displayed is text, not test.

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