I am using jsTree for creating a documentation list index.I use JSON to create my tree. I have a problem and a question.
My problm is, the same icon (default icon set in types) appears for both folders and files. When i change the default icon, all tree icons set to that icon. If i do not use types plug-in, default folder icon is used for all icons.
my jstree config
$("#agac_tutacagi").jstree({ "plugins" : [ "themes", "json_data", "types", "ui"],
"core":{
"animation":500,
"strings":{
"loading":"Yükleniyor"
}
},
"types":{
"types":{
"max_children" : -2,
"max_depth" : -2,
"folder" : {
"valid_children" : [ "default", "dizin", "dosya" ],
"icon" : {
"image" : "/static/p/js/jsTree/_demo/folder.png"
}
},
"file" : {
"valid_children" : "none",
"icon" : {
"image" : "/static/p/js/jsTree/_demo/file.png"
}
},
"default" : {
"icon" : {
"image" : "/static/p/js/jsTree/_demo/file.png"
}
}
}
},
"json_data" : {
"ajax" : {
"url" : "/dokumantasyon/dokumanAgaciOgesiAl/"
}
}
});
my sample JSON is :
[{"data": {"icon": "folder", "title": "Sıkça Sorulan Sorular"}, "children": [{"data": {"icon": "file", "attr": {"onclick": "dokuman_getir(4)"}, "title": "Program makbuz basmadı"}}]}]
icon is set within data dicrionary, as it is shown in sjtree documentation. But it is useless. I get no error, everything is fine except the icond of the tree.
My second question is, how can i configure jstree, so when i click a parent node ( a folder) it will expand as if expand arrow had clicked.
Thanks for your help.