1

I need when page is loaded there wasn't any selection and one cell was shown already

My mean is that I don't need drop down menu or any extra selection, I need in first load one cell based on simple.js come on the page then user with pushing (+) or (-) can make Query

Aslo I am talking about RedQueryBuilder - JavaScript SQL Query Builder UI

AMH
  • 461
  • 5
  • 12
  • Sorry. I'm not sure what you are asking. You don't want a drop down menu? you just want an empty text box? – salk31 Nov 06 '13 at 08:10
  • 1
    Ahh. Do you mean you don't want to select which table? Assuming you are using JS set "from.visible = false" (in the config) and provide it with initial SQL such as "Select id FROM theTableYouWant". This is in the FAQ, please raise a bug if it is not clear. – salk31 Nov 06 '13 at 19:43

1 Answers1

1

Lets do it with simple sample they placed here for download :

http://redquerybuilder.appspot.com/

http://redquerybuilder.appspot.com/static/dist-0.5.0-js.zip

I found easy solution hopefully you like it :

first add jquery.min.js to root beside index.html

second add this line to index :

<script src="jquery.min.js" type="text/javascript" language="javascript">//</script>

now add this part at the end of json file simple.js

before :

    editors : [ {
        name : 'DATE',
        format : 'dd.MM.yyyy'
    } ]
});

add this :

onLoad : function(){
    $('.gwt-ListBox').val('Define Qualifying Criteria');
    $('.gwt-ListBox').change();
    $('.gwt-Button').click();
},

even you can hide select by this :

onLoad : function(){
    $('.gwt-ListBox').val('Questions');
    $('.gwt-ListBox').change();
    $('.gwt-ListBox').hide();
    $('.gwt-Button').click();
},

but you know what this is not your answer you need to find a way to load Saved searches

like example :

[
  {
    "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"
    ]
  }
]
PPPPPPPPP
  • 660
  • 7
  • 14
  • this works but , because I save result some where I am going to load result as well yes so I need Saved searches and load it later – AMH Nov 07 '13 at 00:12
  • Click and change events via jQuery seem to be disabled on elements 'gwt-ListBox' and 'gwt-Button' - any idea why? The original suggestion for adding an initial sql in the RedQueryBuilder.create and making the visibility false works quite well - I would have loved to take even the "Add Condition" button out and go straight to the where clause builder. – dipan66 Jan 16 '15 at 05:16