-
-
Notifications
You must be signed in to change notification settings - Fork 601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Specify select feature #12
Comments
Closing RFC issues, because they should not appear as Open Issue. This thread is still open for discussion! |
I was told in a mail this was still open to discussion and here it seems closed so I'm not sure what it is. But anyway. Since selecting a parent node (in selection mode 3) causes all children of that node to be selected to I feel it's expected behavior for the children to be selected even if they are loaded using lazy loading. If you first expand the parent, then close it and select it all children are selected. To then have the children behave different just because the parent node has not been expanded at least once is not intuitive at all and only looks like something is wrong to the end user. |
thanks!
|
With selectmode=3 I am trying to query the selection status of a node. 'partsel' seems to be true for all nodes in a branch that has one or more nodes in the branch that are partially selected. Is this the intended behavior? My assumption was that partsel would be true only for parent nodes who had less than 100% of their child nodes being selected and one or more child nodes selected. Attaching an image to show you how I expected the attribute to function. |
Currently 'partsel: true' means: 'at least on child is selected', so maybe 'hasSubSel' would have been a better name. 'selected: true' takes precedence, The logic is if( node.selected ) {
// selected
} else if( node.partsel } {
// partially selected
} else {
// unselected
} |
Is it possible to also set the unselectable via API? Perhaps like you set a node selected via API "node.setSelected(bool)" you could also provide a "node.setUnselectable(bool)" for instance. Looks like you can only set unselectable via the initializing (data loading) of the tree. Or am I overlooking something? Regards |
@brumsel: basically it is |
Thanks for the reply. I think I will make a feature request. For now I will implement the renderStatus. I also have another question. It concerns the hideCheckbox option. If I set this option to true in my json, the checkbox is still being shown. Do I have to do a node.renderStatus() as well after loading the json? How do I use the hideCheckbox option? |
renderStatus() should only be required, after a node.ATTRIBUTE was set directly using JavaScript. |
Ok, got it working, no bug. |
Questions should be directed to Stackoverflow or https://groups.google.com/forum/#!forum/fancytree |
fancytree-unselectablemy solution
init: function (event, data) {
data.tree.getRootNode().visit((node) => {
if (!node.selected) {
node.setSelected(true);
} else {
// console.log(`selected true=`, node.selected);
}
if (node.data.noselectable) {
if (node.span.classList) {
node.span.classList.add("fancytree-unselectable");
}
node.unselectable = true;
} else {
// console.log(`unselectable false =`, nodedata.noselectable);
}
});
}, |
Discuss and finalize this RFC:
https://github.com/mar10/fancytree/wiki/SpecSelect
The text was updated successfully, but these errors were encountered: