This is an old revision of the document!
This widget represents “query panel” - a rectangular area of your web-page which contains hierarchical list of query conditions
and provides some operations for manipulating with that list: add a new condition or condition group, remove an existing condition, enable/disable conditions, etc.
All options of QueryPanel widgets can be set through queryPanel property of easyQuerySettings global variable.
Of course you can also set options and call methods of QueryPanel in an usual for jQuery widgets way.
Options
listRequestHandler
Type:Function
Default:null
Sets a callback function which returns lists for “CustomList” value editors
Code examples:
var QPDiv = $('#QueryPanel');
QPDiv.QueryPanel(“listRequestHandler, function(listName, onResult){
if (listName == “RegionList”) {
onResult([
{ id: “CA”, text: “California” },
{ id: “CO”, text: “Colorado” },
{ id: “OR”, text: “Oregon” },
{ id: “WA”, text: “Washington”}
]);
}
else {
onResult(null);
}
});
showRootRow
Type:Boolean
Default:true
Gets or sets a value indicating whether query panel must show a root row which represents the main group of conditions
showAddRow
Type:Boolean
Default:true
Gets or sets a value indicating whether query panel must show a special [add condition] link at the bottom
showCheckboxes
Type:Boolean
Default:false
Gets or sets a value indicating whether query panel must show a checkbox at the beginning of each condition row.
User will be able to use these checkboxes to enable/disable corresponding query conditions
showPoweredBy
Type:Boolean
Default:true
Allows to turn off “Powered by EasyQuery” link shown in the bottom right cornder of query panel. Works only in the full version of the script.
Type:Boolean
Default:false
If true QueryPanel widget will always show button in predicate (group) rows.
Instead of default behaviour when they are shown only on mouse over.
Type:Boolean
Default:false
If true QueryPanel widget will always show button in condition rows.
Instead of default behaviour when they are shown only on mouse over.
showConjunctions
Type:Boolean
Default:true
If true QueryPanel widget will show conjunction elements (“and” or “or”) at the beginning of each condition.
accentActiveCondition
Type:Boolean
Default:true
If true the active condition (the one user clicked on previously) will have accent background color.
activateRootOnStart
Type:Boolean
Default:true
If true root predicate row become active at the beginning.
Type:String
Default:mm/dd/yy
A string that represents the format of date values used in date/time picker widget.
Type:String
Default:d MM, yy
The format of date values used in condition rows.
Type:String
Default:{entity} {attr}
The format of entity attributes used in query panel conditions.
You can set it to '{attr}' to shown only attribute part (without entity name)
Type:Number
Default:30
If the number of items in drop down menu exceeds this number then a search box will be displayed. Set this option to 0 if want to show the search box in any case
Methods
clearConditions
Clears the list of conditions in associated query and redraws a panel if needed
Code examples:
var QueryPanelDiv = $(”#QueryPanel”);
QueryPanelDiv.QueryPanel('clearConditions');
clearQuery
Clears all parts (list of conditions, list of columns) in associated query and redraws a panel if needed
Code examples:
var QueryPanelDiv = $(”#QueryPanel”);
QueryPanelDiv.QueryPanel('clearQuery');
editConditionValue
Turns the row for condition passed in parameter into “edit” mode.
If no parameter is passed then it switch on edit mode for current active row.
Code examples:
var QueryPanelDiv = $(”#QueryPanel”);
QueryPanelDiv.QueryPanel('editConditionValue');
addNewCondition
Creates a new simple condition with attribute and operator based on their IDs passed in parameters
and then adds this new condition into the root predicate.
Parameters:
attrid
Type:String
Attribute ID. By default attribute ID is equals to TableName.FieldName of corresponding column.
operid
Type:String
Operator ID (e.g. 'Equals', 'StartsWith', etc).
Code examples:
var QueryPanelDiv = $(”#QueryPanel”);
QueryPanelDiv.QueryPanel('addNewCondition', 'Orders.Paid', 'IsTrue');
Activates the particular condition in the panel
Parameters:
conditionWidget
Type:Object
The ConditionRow_SMPL or ConditionRow_PDCT object to activate.
Discussion
By default all EasyQuery widgets are connected to default Query object created automatically during initialization (the one you can get using EQ.client.getQuery() function).
To place second QueryPanel on your page you will need to create one more Query object "manually" and connect it with that QueryPanel.
May I ask why you need to QueryPanel object on your page?
However, you still didn't describe why you need to build 2 queries (filters) on one page.
https://almsaeedstudio.com/themes/AdminLTE/index2.html