Question

when we save a result as a Saved searches like this

[
  {
    "label": "Cities in the UK",
    "sql": "SELECT \"x0\".\"ID\", \"x0\".\"NAME\", \"x0\".\"COUNTRYCODE\", \"x0\".\"DISTRICT\", \"x0\".\"POPULATION\" FROM \"CITY\" \"x0\" INNER JOIN \"COUNTRY\" \"x1\" ON \"x0\".\"COUNTRYCODE\" = \"x1\".\"CODE\" WHERE (\"x1\".\"NAME\" = ?)",
    "args": [
      "United Kingdom"
    ]
  },
  {
    "label": "Large cities in the UK plus Oxford",
    "sql": "SELECT \"x0\".\"ID\", \"x0\".\"NAME\", \"x0\".\"COUNTRYCODE\", \"x0\".\"DISTRICT\", \"x0\".\"POPULATION\" FROM \"CITY\" \"x0\" INNER JOIN \"COUNTRY\" \"x1\" ON \"x0\".\"COUNTRYCODE\" = \"x1\".\"CODE\" WHERE ((\"x1\".\"NAME\" = ?) AND ((\"x0\".\"POPULATION\" > ?) OR (\"x0\".\"NAME\" = ?)))",
    "args": [
      "United Kingdom",
      "100000",
      "Oxford"
    ]
  },
  {
    "label": "Official languages",
    "sql": "SELECT \"x0\".\"COUNTRYCODE\", \"x0\".\"LANGUAGE\", \"x0\".\"ISOFFICIAL\", \"x0\".\"PERCENTAGE\" FROM \"COUNTRYLANGUAGE\" \"x0\" WHERE (\"x0\".\"ISOFFICIAL\" = ?)",
    "args": [
      "T"
    ]
  }
]

how we can load this as soon as we load RedQueryBuilder

Was it helpful?

Solution

The create method can take sql and args as the second and third arguments. So as long as you have the above data before you create the widget you can start it up with whatever you like.

The jsdocs are in the zip. Please raise a bug if they are not obvious or clear.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top