我需要在加载页面时没有任何选择,并且已经显示了一个单元格
我的意思是我不需要下拉菜单或任何额外的选择,我需要首先加载一个基于simple.js的单元格来到页面然后用户推送(+)或( - )可以进行查询
Aslo我在谈论RedQueryBuilder - JavaScript SQL Query Builder UI
答案 0 :(得分:1)
让我们把它们放在这里下载的简单样本:
http://redquerybuilder.appspot.com/
http://redquerybuilder.appspot.com/static/dist-0.5.0-js.zip
我找到了简单的解决方案,希望你喜欢它:
首先将jquery.min.js添加到index.html
旁边的root第二次将此行添加到索引:
<script src="jquery.min.js" type="text/javascript" language="javascript">//</script>
现在在json文件simple.js
的末尾添加此部分之前:
editors : [ {
name : 'DATE',
format : 'dd.MM.yyyy'
} ]
});
添加:
onLoad : function(){
$('.gwt-ListBox').val('Define Qualifying Criteria');
$('.gwt-ListBox').change();
$('.gwt-Button').click();
},
即使你可以隐藏选择:
onLoad : function(){
$('.gwt-ListBox').val('Questions');
$('.gwt-ListBox').change();
$('.gwt-ListBox').hide();
$('.gwt-Button').click();
},
但是你知道这不是你的答案,你需要找到一种方法来加载保存的搜索
例如:
[
{
"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"
]
}
]