1

当我们将结果保存为这样的已保存搜索时

[
  {
    "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"
    ]
  }
]

我们如何在加载 RedQueryBuilder 后立即加载它

4

1 回答 1

2

create 方法可以将 sql 和 args 作为第二个和第三个参数。因此,只要您在创建小部件之前拥有上述数据,就可以使用任何您喜欢的方式启动它。

jsdocs 在 zip 中。如果它们不明显或不清楚,请提出错误。

于 2013-11-07T08:51:14.573 回答