Skip to content
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

Closed
mar10 opened this issue May 12, 2013 · 12 comments
Closed

RFC: Specify select feature #12

mar10 opened this issue May 12, 2013 · 12 comments
Labels
Milestone

Comments

@mar10
Copy link
Owner

mar10 commented May 12, 2013

Discuss and finalize this RFC:

https://github.com/mar10/fancytree/wiki/SpecSelect

@mar10
Copy link
Owner Author

mar10 commented Mar 3, 2014

Closing RFC issues, because they should not appear as Open Issue.

This thread is still open for discussion!

@inquam
Copy link

inquam commented Jun 19, 2014

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.

@mar10
Copy link
Owner Author

mar10 commented Jun 19, 2014

thanks!
p.s.
see above:

Closing RFC issues, because they should not appear as Open Issue.This thread is still open for discussion!

@alleroux
Copy link

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.

selected

@mar10
Copy link
Owner Author

mar10 commented Aug 21, 2014

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
}

@brumsel
Copy link

brumsel commented Nov 6, 2014

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

@mar10
Copy link
Owner Author

mar10 commented Nov 6, 2014

@brumsel: basically it is node.unselectable = true; followed by node.renderStatus(), but you may open an issue for the feature request.

@brumsel
Copy link

brumsel commented Nov 6, 2014

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?

@mar10
Copy link
Owner Author

mar10 commented Nov 7, 2014

renderStatus() should only be required, after a node.ATTRIBUTE was set directly using JavaScript.
If passed with JSON, it should not be required. If you found a bug there, pleas open an issue for this.

@brumsel
Copy link

brumsel commented Nov 20, 2014

Ok, got it working, no bug.
Is there some forum support where I can leave questions or do I have to post them on github?

@mar10
Copy link
Owner Author

mar10 commented Nov 20, 2014

Questions should be directed to Stackoverflow or https://groups.google.com/forum/#!forum/fancytree

@xgqfrms
Copy link

xgqfrms commented Jun 1, 2018

fancytree-unselectable

my solution

result

json

    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);
            }
        });
    },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants