-
-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Custom Object Structure for TreeSelect Value State #36713
Comments
You may look for issues: |
What's |
@zombieJ or if it has children in looks like this: Displaying the tree in the dropdown isn't the problem. But under my Tree Select I have three radio buttons which indicate if the selected value will be a "search AND", "search OR", or "search NOT" value. but I can only store strings in the selected value state. As you can see in the documentation the "value" attribute for TreeSelect can only be String or String[] But I need a possibility to pass my custom object like |
Could you provide a screenshot for this? |
Sure. This is the kind of search Filter I want to build. This was built using the normal Input Component with the Autocomplete component. But When selecting values from the treeselect it only returns string or an array of strings, so I can't add the searchType property right now. As I said before when passing the value containing the state for the selected options I can only pass string oder array of strings to the component. |
Looks like You're trying to combine 2 components - |
@RuFi2k wow thank you so much! Learned a lot looking at that example :) |
What problem does this feature solve?
The current implementation only allows the value state for the TreeSelect to be of type string or string[]. In some cases you want to have more information for each selected value. For instance: When building a search UI you might want to add a different search type to each selected value like "and", "or", "not" in order to indicate how the values are going to be used. In that case it would be nice to have the option to store objects in that state like {value: "testValue", type: "and"}
This is different from the fieldNames property since fieldNames only tells the TreeSelect the name of the properties for the TreeNodes not for the state of the currently selected values
So I need the state to look line this:
{
value: [{value: "selectedValue1", type: "and"}, {value: "selectedValue2", type: "or"}, ...]
}
not like this:
{
value: ["selectedValue1", "selectedValue]
}
What does the proposed API look like?
Well there should by a possibility to tell the component which property of the value state object is going to be the label value within the value state where the selected values are stored NOT the fieldNames of the Treenodes. So it is similar to the fieldNames Property but not for the Nodes of the tree. It should work for the selected values instead
The text was updated successfully, but these errors were encountered: