I try to show in a Tree panel a Files System. I feed my tree with json data and it's work perfectly!
But when I have an empty folder, the tree folder (when it's deploy) show me the complete tree again. In my server I send a json file which doesn't have children properties.
This is my tree code
Ext.onReady(function () {
var treeStore = Ext.create('Ext.data.TreeStore', {
proxy: {
type: 'ajax',
url: '/File/Tree'
},
root: {
text: 'Files root',
id: 'root',
expanded: true
}
});
var treeUp = Ext.create('Ext.tree.Panel', {
id: 'TreeFileSystem',
title: 'TEST',
useArrows: true,
store: treeStore,
rootVisible: false,
renderTo: 'Tree',
height: 350,
listeners: {
itemClick: function (view, record) {
}
}
});
});
and there is an example of my json code
[
{"cls":"first-level","expanded":"false","children":[
{"cls":"first-level","expanded":"false","children":[
{"leaf":"true","text":"..."},
{"leaf":"true","text":"..."}
],"text":"..."}
],"text":"..."},
{"text":"..."}]
Anybody has an idea for help me?
Thanks!
David
EDIT:
an other example of my JSON
[
{"path":"...","cls":"first-level","expanded":"false","children":[
{"path":"...","cls":"first-level","expanded":"false","children":[
{"path":"...","cls":"first-level","expanded":"false","children":[],"text":"BOBFOLDER1"},
{"path":"...","cls":"first-level","expanded":"false","children":[],"text":"BOBFOLDER2"},
{"path":"...","cls":"first-level","expanded":"false","children":[],"text":"BOBFOLDER3"}
],"text":"BOB"},
{"path":"...","cls":"first-level","expanded":"false","children":[
{"path":"...","expanded":"false","text":"OTHERFOLDER1"}
],"text":"OTHER"}
],"text":"20508322"}]
I explain with that -> BOBFOLDER1, BOBFOLDER2, BOBFOLDER3 contains files and don't have arrow (I can't deploy it and it's the good behaviour). But OTHERFOLDER1 don't contains files and have an arrow which display root again (same of my picture i give in comments) it's the problem!