Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Hierarchical multiple select - parent items are completely removed from drop down, cannot add their children #795

Open
ni-ka opened this Issue · 4 comments

3 participants

@ni-ka

Hey,

in earlier versions it was possible to select a parent element in multiselect, and its children elemen where still selectable. The parent element was disabled and could not be selected anymore but its children were not removed from the drop down.

Now the behavior has changed and items are removed completely upon selection, so if you select a parent item you can't select any of its children anymore.

See http://plnkr.co/edit/UQ3ur38TC6uVxLv8xvUr?p=preview

compared to http://plnkr.co/edit/a6rrYHYbLDtEB27K3j77?p=preview (version 3.2, has another issue though).

Maybe the behavior should be configurable?

Best,

Nils

@ivaynberg
Owner

pull request to make it configurable is welcome

@ni-ka

I had a look at it and actually manage to code something. However, if we keep the current behavior (selecting parent selects - and hides - children), we probably need to add code to modify the selection. Example

""
Root
    Parent
        Child

If user selects Child, the item is selected and thus hidden and added to the list

"Child"
Root
    Parent

If user selects Parent, the item is selected and thus hidden and added to the list

"Child, Parent"
Root

If user would have selected parent first, the value would be "Parent" only. So should the value be changed so that if the parent of a previously selected Child is added, its children are removed from the value?

What do you think?

@ivaynberg
Owner

the problem is there are many permutations of this behavior

to start with there are choices of what to do in the result list - the available choices
1.1 when parent is selected remove parent and children from the list of available choices
1.2 when parent is selected disable the parent, leave children available for further selection

then there are choices of what happens with the list of selected elements
2.1 when a parent is selected leave any selected children
2.2 when a parent is selected remove any children
2.3 when a child is selected remove any selected parents

these are just the ones that come to mind right now.

supporting the removal of children/parents can be accomplished by storing path to root along with the id of every selected choice. but the question is how to best support all these possible permutations...

@coorasse

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.