Skip to content

When i closed expand mode parent removed from expand array #134

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

Open
ashokblobstation opened this issue Feb 22, 2019 · 1 comment
Open
Labels

Comments

@ashokblobstation
Copy link

Hello Everyone

So guys, i have a simple question

I want some another scenario when i click on any child then related parent should be checked automatically and it should be pushed in another parent array.
Here is the problem,
image 1
Currently when i clicked on child it is automatically checked parent in expand mode,but when i closed expand it is removed from array automatically.

@jakezatecky
Copy link
Owner

I apologize for not responding to this earlier, but I had trouble understanding this when I initially saw the issue. I think I understand it now. If I understand you correctly, the intent is to have some way to track which parent nodes have checked children, and you would have liked to use the expanded property to store this information.

Unfortunately, there is no way to do this in the current version. The expanded array serves quite a different purpose. Nevertheless, your use case is very similar to long-standing issue #13, which would only have the uppermost selections in the checked array.

Your use case might be a bit different that what is in #13, but v2.0 might be moving to a slightly different model that would store all of the check state data on the individual nodes themselves, which may provide greater flexibility for your use case, though that will not be ready for a while.

For now, the simplest way to work around the issue for you would be to iterate through the checked array, split each item by the underscore (_), remove the duplicates, and store it in some other variable, say parents. That way you would have ['affiliate', 'offer_type', 'group'].

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

2 participants