Open DasTobbel opened 1 year ago
Logically speaking, if a node has children then it should be expandable, otherwise, it shouldn't have any children. So, I would rather not have this functionality, but you are free to create your own fork for this change set.
Ah, let me rephrase it: I want to forbid the collapsing of node+children as i click on the node.
Currently if i use the treeview and the node has children, the "onItemTap" function will collapse/expand the clicked node while executing the "onItemTap" function.
Probably something like this, while adding the default "node.mayCollapse = true"?
Future<void> toggleExpansion(ITreeNode<Data> item) async {
if (item.isExpanded && item.children.isNotEmpty && item.mayCollapse == false) {
return;
}
else if (item.isExpanded && item.mayCollapse)
await collapseNode(item);
else {
expandNode(item);
await applyExpansionBehavior(item);
}
}
Hi, i'm looking for a way to, based on the item, to deactivate the expansion/collapse of its children. Is there a way currently ?
Or is it something you want to achieve? If yes, my suggestion would be something like, i could do the PR:
Greets!