icon folder to all nodes

1,515 views
Skip to first unread message

Carine Chambon

unread,
Sep 5, 2014, 6:03:38 AM9/5/14
to jst...@googlegroups.com
hi

I don't know where I miss but all my nodes have the folder icon

My initialization :
  $("#sommaire").jstree({
       
"core" : {
       
"animation" : 0,
       
"check_callback" : false,
       
"themes" : { "stripes" : true }        
       
},
     
'types': {
       
"default": {
           
"icon": "jstree-default jstree-folder",
           
"valid_children": ["default","file"]
       
},
       
"file": {
           
"icon": "jstree-file",
           
"valid_children": []
       
}
   
},
   
'plugins': ['types']
})

when I build my list I add
$html .= '<li data-jstree="{\'icon\':\'jstree-file\'}">';

because the intilization don't work alone.

all my tests give me the same icon, even if I can change the icon
the result is the same :
<ul class="jstree-children" role="group">
 
<li id="j1_3" class="jstree-node jstree-leaf" role="treeitem" data-jstree="{'icon':'jstree-file'}" aria-selected="false">
 
<i class="jstree-icon jstree-ocl"></i>
 
<a class="jstree-anchor jstree-clicked" href="#">
   
<i class="jstree-icon jstree-themeicon jstree-default jstree-folder jstree-themeicon-custom"></i>
   
<span onclick="AJAX_Editer_Page(244)"> Real time access[(244)]</span>
 
</a>
 
</li>

I'm just started to use jstree maybe I miss something obvious, sorry, and sorry for my english too :)

Thanks



Ivan Bozhanov

unread,
Sep 5, 2014, 5:06:02 PM9/5/14
to jst...@googlegroups.com
Use data-jstree='{"icon":",,,"}'
Or use
data-jstree='{"type":".."}'

Anyway - the quotes should be the other way around to be valid (single quotes outside, double inside), this is not a jstree thing - it is a jQuery & JSON.parse issue.

Best regards,
Ivan
Reply all
Reply to author
Forward
0 new messages