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

How to get a list of checked items? #56

Open
TNortnern opened this issue Jun 30, 2021 · 3 comments
Open

How to get a list of checked items? #56

TNortnern opened this issue Jun 30, 2021 · 3 comments

Comments

@TNortnern
Copy link

Using @change only shows individual item getting checked. How I get a collection of all current checked items?

@phphe
Copy link
Owner

phphe commented Jun 30, 2021

function getAllChekced(){
  const checked = [];
  tree.walkTreeData((node) => {
    node.$checked && checked.push(node)
  })
  return checked
}

@TNortnern
Copy link
Author

TNortnern commented Jun 30, 2021

Yeah this works for top level nodes but not children. I think there should be a onChecked event that sends all the items that were checked back to the parent. So if you check a top level parent then you should receive the top level and the children.

@phphe
Copy link
Owner

phphe commented Jul 14, 2021

I tested. The getAllChekced function above is able to get all checked. The walkTreeData function will walk all nodes.

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

No branches or pull requests

2 participants