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

Hierarchical structure #949

Open
PisceanPurva opened this issue May 12, 2022 · 0 comments
Open

Hierarchical structure #949

PisceanPurva opened this issue May 12, 2022 · 0 comments

Comments

@PisceanPurva
Copy link

Hi ,
I wanted to create a hierarchy using this plugin, Right now what i saw, is it groups the rules together ,but they are not in any hierarchical structure.
Can i customize this plugin, if so how?

{
"condition": "AND",
"rules": [
{
"id": "price",
"field": "price",
"type": "double",
"input": "number",
"operator": "less",
"value": 10.25
},
{
"condition": "OR",
"rules": [
{
"id": "category",
"field": "category",
"type": "integer",
"input": "select",
"operator": "equal",
"value": 2
},
{
"id": "price",
"field": "price",
"type": "double",
"input": "number",
"operator": "equal",
"value": 1
}
]
},
{
"id": "name",
"field": "name",
"type": "string",
"input": "text",
"operator": "equal",
"value": "Test"
}
],
"valid": true
}

SO as per this eg:
image

price, group(category & price) and name they all are in same level, but what if i want to define that group(category & price) inside the price(1st block) so that when i do get rules, i should get something like this.

Please help.

This is what i am expecting to create a json:
{
"condition": "AND",
"rules": [
{
"id": "price",
"field": "price",
"type": "double",
"input": "number",
"operator": "less",
"value": 10.25,
"rules": [
{
"condition": "OR",
"rules": [
{
"id": "category",
"field": "category",
"type": "integer",
"input": "select",
"operator": "equal",
"value": 2
},
{
"id": "price",
"field": "price",
"type": "double",
"input": "number",
"operator": "equal",
"value": 1
}
]
}
]
},
{
"id": "name",
"field": "name",
"type": "string",
"input": "text",
"operator": "equal",
"value": "Test",
"rules": []
}
],
"valid": true
}

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

1 participant