0

I have requirement to get the optgroup of selected field in the query builder, but as of I am aware queryBuilder('getRules') doesn't provide. For example:- I want to get optgroups object of selected field 'price' in the json output. How to get it? Please give some idea.

-optgroups object

 optgroups: {
        core: {
          en: 'Item'
        }
      }

-json output object

{
  "condition": "AND",
  "rules": [
    {
      "id": "price",
      "field": "price",
      "type": "double",
      "input": "text",
      "operator": "less",
      "value": "10.25"
    }
  ]
}
kaushik_pm
  • 295
  • 3
  • 10

1 Answers1

0

As I was answered for this question on GitHub by the library developer(@mistic100). The answer is-

You can use the data property of the filter https://querybuilder.js.org/index.html#filters It will be copied as it on each rule using the said filter.

kaushik_pm
  • 295
  • 3
  • 10