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

CheckTree : Structured data from onChange callback function #1685

Open
uniquepj opened this issue May 17, 2021 · 1 comment
Open

CheckTree : Structured data from onChange callback function #1685

uniquepj opened this issue May 17, 2021 · 1 comment
Labels

Comments

@uniquepj
Copy link

Hi team,
I would like to suggest one feature in CheckTree, I am in need of this feature in my project. From the onChange (or we can consider onComplete as a new callback) callback function, it would be great if we give structured js object as output with only checked values in it.
Let's consider the basic case for the feature, consider the following JSON for CheckTree :

[
  {
    "label": "parent1",
    "value": "parent1",
    "children": [
    	{
        "label": "parent1-child1",
        "value": "parent1-child1",
        "children": [
          {
            "label": "parent1-child1-child1",
            "value": "parent1-child1-child1"
          },
          {
            "label": "parent1-child1-child2",
            "value": "parent1-child1-child2"
          }
         ]
      },
  		{
        "label": "parent1-child2",
        "value": "parent1-child2"
      }
    ]
  },
  {
   "label": "parent2",
    "value": "parent2",
    "children": [
    	{
        "label": "parent2-child1",
        "value": "parent2-child1"
      },
  		{
        "label": "parent2-child2",
        "value": "parent2-child2"
      }
    ]
  }
]

Let's say in parent1, parent1-child1-child1 and parent1-child1-child2 are checked and in parent2, parent2-child2 is checked.
For the onChange callback, the output object likely to be as follows:

[
  {
    "parent1": {
      "parent1-child1": ["parent1-child1-child1","parent1-child1-child2"]
    }
  },
  {
    "parent2": ["parent2-child2"]
  }
]

The example is for a basic case, there would be nested children in one tree, we have to consider that also.
I look forward to hearing from you as soon as possible. Thanks

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 16, 2022
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

1 participant