Open paulmoise opened 3 months ago
Hey,
I am working around that by putting everything in the "value" I want to be able to search for.
Example:
class Question():
def __init__(self, id, label, question_text):
self.id = id
self.label = label
self.question_text = question_text
question = Question(5, "Label", "Question Text")
node = {
"value": f"""{{"id": {question.id}, "label": "{question.label}", "text": "{question.question_text}"}}""", #value is a dictionary as a string
"title": f"{question.label if show_question_label else question.question_text}",
}
Then you can read out the return value like this:
import ast
return_value = ast.literal_eval(return_object_by_component)
Is there a possible way to change the key used by the component to filter the data ?
tree_data = [ { "value": 1, "title": """Test <i> <b style="color:green"> parent HTML</b></i> test""", "children": [ { "value": 2, "title": "parent 1-0", "children": [ { "value":3, "title": "leaf1", }, { "value": 4, "title": "leaf2", }, ], }, { "value": 5, "title": "parent 1-1", "children": [ { "value":7, "title": """<i> <b style="color:green">leaf3</b> </i>""", }, ], }, ], }, ]
for example, the value there is the number but the filter should work on the title.