-
-
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
Revisit 'unselectable' flag (in multy-hier mode) #153
Comments
This behavior is a bit complicated and not yet finally specified: https://github.com/mar10/fancytree/wiki/SpecSelect (I modified the issue title to reflect this) Comments welcome. |
This issue is the same as #305 in dynatree (https://code.google.com/p/dynatree/issues/detail?id=305). It was not resolved there. Hope it will be resolved in fancytree.
Fig 1. Clicking on top level node selects all children including unselectable child. Incorrect. Fig 2. Selecting all child nodes except unselectable makes all parent nodes fully selected. Probably incorrect for most cases. If all nodes collapsed user don't know if there are any unselectable items and could wrongly think that all child nodes are selected (despite there are some problems with nodes that can't be selected). |
Thanks for contributing! Maybe you can add a concrete use-case / story for this expectation? One usecase might be: We want to insert a dummy node that acts as a sub-title. So we set 'uselectable' and 'checkbox: false'. Another usecase might be: We have a tree of options, that a user can edit, but some of them are readonly (some forced to selected, some unselected). The user would like to easily set or reset all editable settings, for example by clicking the parent checkbox. I agree that it is not consistent yet, but some decisions that I am not sure about:
|
Sorry for late reply.
But the last question is not that easy to answer. Especially after you examples I realized that there are some cases when it's possible to have node selected but also have uselectable option set to prevent user interaction. But still, user should not be able to drop the selected flag on node by deselecting parent node (like it is in current version of fancytree). |
Hi mar10, I think the wording 'unselectable' is a litte bit missleading .... The 'unselectables', like they work now, are for those cases where e.g. 'dummy nodes' are needed. So they should never be selected. Hiding 'disabled' nodes is not an option, because it looks ugly and forces misunderstanding to the user. Fading them would be better, imho. The 'disabled' nodes belong to the user action and have effect on the 'is selected' state.
What do you think about that? . (Apart from being a major change.) That might also go hand in hand with #327 ;) And as always 'never trust what you get from a javascript', one - I'd say - must anyway implement some fancy server logic. |
Hi mar10, First of all thanks for creating fancytree, which is a really awesome plugin. Problem and Use caseI would like to ask that whether this issue going to be solved? Here's my use case:
But when I implement the tree table I found that in selectMode 3 (multi-hier) when I change the status of one parent node, the disabled node are also changed, which is not the expected behavior. Solutions?I have read the specSelect and noticed there's one sentence:
So I would like to know if there's any solutions to get around with this - or should we made some code patch so let it behave as expected? Thank you again for fancytree and I would be really appreciated to get some response. Regards, |
I am closing this in favor of a general refactoring: #626 but some thoughts:
Yes 'unselectable' is misleading, but 'disabled' as well IMO, because I would assume that such a node cannot be made active, i.e. cannot be clicked on.
Haven't tested, but the behavior should be consistent with plain trees. This would be a bug and should be reported separately |
When I use unselectable flag for a node I suppose it shouldn't be ever selected, but it's selected with selection of parent node.
It's usefull when I attach some tree-organized entities to different records, but I want to disallow selection for entityes attached to another records.
Is it possible to add a new multiselect mode for this purpose?
The text was updated successfully, but these errors were encountered: