Closed OldManMeta closed 2 years ago
Ok - I just noticed that you can pass an array of id's in - so I wrote this function to get them
`const getFolderItems = (treeData:NodeModel[]):[]=>{ var TreeFolders:[]=[];
treeData.map((item)=>{
if(item.isFolder){
TreeFolders.push(item.id);
}
});
return TreeFolders;
}`
Obviously, calling it with:
initialOpen={getFolderItems(treeData)}
You will need to modify the data and structures to contain a value of isFolder:boolean
The InitialOpen={true} appears to only target droppable folders so to speak.
I have a scenario where some folder can take certain files but not others, so being able to ensure all folders, and not just droppable=true was expanded would provide a wider experience.
Perhaps allow an object to specify the InitialOpen target instead of just a bool?
Cheers