Difference between revisions of "QueryBuilder"
Barrymavin (Talk | contribs) (→Query Builder Parameters) |
Barrymavin (Talk | contribs) (→Slide in a Query Builder Dialog Panel) |
||
Line 68: | Line 68: | ||
<code lang="javascript"> | <code lang="javascript"> | ||
− | + | var sectionid = "page1.section1"; // or "myCallBackHandler()" | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | var | + | |
− | + | ||
var database = "southwind"; | var database = "southwind"; | ||
var table = "order_details"; | var table = "order_details"; | ||
− | var | + | var columns = ""; |
− | var | + | var filter = ""; |
− | Lianja.showQueryBuilderPanel( | + | Lianja.showQueryBuilderPanel(sectionid, database, table, columns, filter); |
</code> | </code> |
Revision as of 00:46, 12 June 2018
Under construction
Contents
Overview
To keep coding (NoCode) to a minimum there are many built-in WebViewWidgets that can be used with Lianja.showDialogPanel(), Lianja.showDialog() or as the URL in a WebView section or in a custom WebView object created with createObject("webview").
The Query Builder is a powerful WebViewWidget that can be integrated into your Apps to provide end-users with the ability to drill down through data without you having to write any custom code.
A picture says a thousand words so let's look at the Query Builder then see how we can use it in our Apps.
You will typically want to show the Query Builder when the "Search Icon" in pages and/or sections is clicked.
Using the Query Builder in Pages
Now let's see that in action.
Using the Query Builder in Sections
Now let's see that in action.
Query Builder Parameters
lib:/querybuilder.rsp?parameter=value¶meter=value...
Parameter | Description | Default value |
---|---|---|
database | ||
table | ||
sectionid | If this is specified e.g. page1.section then the filter will be applied as a searchfilter to the page or section. If it is not specified you can specify an onselect delegate | |
columns | A comma separated list of columns | |
filter | An initial filter that can be edited | |
minbuttons | If true only Cancel and Done buttons are shown | false |
onselect | The optional delegate to be called when a query is applied. The delegate is called with one argument, the sql condition that has been built. |
Slide in a Query Builder Dialog Panel
var sectionid = "page1.section1"; // or "myCallBackHandler()" var database = "southwind"; var table = "order_details"; var columns = ""; var filter = ""; Lianja.showQueryBuilderPanel(sectionid, database, table, columns, filter);
Popup a Query Builder Dialog
function myQueryPickerCallback(key, value) { messageBox("You chose '"+value+"'"); } var title = "Browse Orders"; var onselect = "myQueryPickerCallback()"; var database = "southwind"; var table = "order_details"; var params = ""; // e.g. parameter=value¶meter2=value... var width = 900; Lianja.showQueryBuilder(title, onselect, database, table, params, width);