liquor-tree
liquor-tree copied to clipboard
How to access data coming from server without changing its structure?
I have the following data:
"Conditions": [
{
"Values": [
"test"
],
"Operator": "Equals",
"Condition Type": "Project Name Rule"
},
{
"Values": [
"flower"
],
"Operator": "Contains",
"Condition Type": "Project Description Rule"
},
{
"Conjunction": true,
"Conditions": [
{
"Values": [
"test value"
],
"Operator": "Does Not Contain",
"Condition Type": "Project Description Rule"
},
{
"Values": [
"another test value"
],
"Operator": "Does Not Equal",
"Condition Type": "Project Name Rule"
}
],
"Condition Type": "Composite Rule"
}
],
"Condition Type": "Composite Rule"
I need to load this "as-is" into the tree, and then access each prop using, e.g. node.data.Operator
or node.data.Values
. Is this possible?
I'm not able to use computed properties in this scenario.
In the tree options you can replace the data containers :
treeOptions: {
propertyNames: {
text: 'name',
score: colorder,
children: 'kids', ...
}
}