Back to
Latest changes:
2020/01/13 19:15

easyQuerySettings variable

All options of EasyQuery widgets and core objects (such as DataModel and Query) can be specified through a special easyQuerySettings global variable.

Just set the value of this variable before including EasyQuery script files (such as eq.all.min.js or eq.view.js) into your HTML page.

easyQuerySettings

Type:Object
serviceUrl
Type:String
Default:“EasyQuery”
The URL to access the server-side service that communicates with EasyQuery controls.
modelName
Type:String
Default:””
The name of the model that should be loaded.
syncQueryOptions
Type:Object
Default:null
The additional parameters that can be passed to the server to adjust query statement generation.
Only sqlOptions property is supported:

  syncQueryOptions: {
    sqlOptions: {SelectDistinct:true}
  }

All possible values are described in EasyQuery.Db.DbOptions Properties

listRequesHandler
Type:Function
Default:null
Sets a callback function which returns lists for “CustomList” value editors.
Code examples:

window.easyQuerySettings = {
. . . . . . . . . .
  listRequesHandler: function (params, onResult) {
    if (listName == "RegionList") {
      onResult([
        { id: "CA", text: "California" }, 
        { id: "CO", text: "Colorado" }, 
        { id: "OR", text: "Oregon" }, 
        { id: "WA", text: "Washington"}
      ]);
    }
    else {
      onResult(null);
    }
  }
. . . . . . . . . .
};

queryPanel
Type:Object
Default:null
Sets options of QueryPanel widget. See QueryPanel.options description for details.
columnsPanel
Type:Object
Default:null
Sets options of ColumnsPanel widget. See ColumnsPanel.options description for details.
entitiesPanel
Type:Object
Default:null
Sets options of EntitiesPanel widget. See EntitiesPanel.options description for details.

The below described properties are URLs to different actions that are performed on server side. Usually you don't need to change them.
Actual URL is a combination of serviceUrl and the property value. You meay need to change these properties if you implement your own server-side service. For example, if you need server side to be written on PHP, Java or some other non-C# language.

loadModelUrl
Type:String
Default:“GetModel”
URL of the action that gets the model by its name

loadQueryUrl
Type:String
Default:“GetQuery”
URL of the action that gets the query by its name

saveQueryUrl
Type:String
Default:“SaveQuery”
URL of the action that saves the query passed as JSON string with specified name

syncQueryUrl
Type:String
Default:“SyncQuery”
URL of the action that should be called when the query on client side is changed.

executeQueryUrl
Type:String
Default:“ExecuteQuery”
URL of the action that executes the query passed as JSON string and returns the result record set (again as JSON)

listRequestUrl
Type:String
Default:“GetList”
URL of the action that returns a custom list by different list request options (list name)

loadQueryListUrl
Type:String
Default:“GetQueryList”
URL of the action that return the list of available queries

Code examples:

  //Settings for EasyQuery widgets 
  window.easyQuerySettings = {
      serviceUrl: "/EasyQuery",
      modelName: "NWindSQL",
      entitiesPanel: { showCheckboxes: true },
      columnsPanel: { allowAggrColumns: true, attrElementFormat: "{entity} {attr}", showColumnCaptions: true, adjustEntitiesMenuHeight: false },
      queryPanel: { alwaysShowButtonsInPredicates: false, adjustEntitiesMenuHeight: false, menuSearchBoxAfter: 20 },
      syncQueryOptions: {
          sqlOptions: {SelectDistinct:true}
      },
 
      listRequesHandler: function (params, onResult) {
         //listRequest event handler goes here
      }
  };

easyQueryViewSettings variable

The EQ.view unit contains different functions for managing core EasyQuery pages (views): process user input, render result set, etc. All options that unit can be specified through a special easyQueryViewSettings global variable.

Just set the value of this variable before including EasyQuery script files (such as eq.all.min.js or eq.view.js) into your HTML page.

easyQueryViewSettings

Type:Object
syncQueryOnChange
Type:Boolean
Default:true
Indicates whether the SyncQuery action should be called if the query has changed

showChart
Type:Boolean
Default:true
Indicates whether EasyQuery should try to build a chart on the basis on returned result set

The below described properties are IDs of different interface elements that may be used by EasyQuery for some default behavior (load/save queries, display generated SQL, etc.)

resultPanelId
Type:String
Default:“ResultPanel”
The ID of the element that displays the result set

sqlPanelId
Type:String
Default:“SqlPanel”
The ID of the element that displays the returned SQL

clearQueryButtonId
Type:String
Default:“ClearQueryButton”
The ID of the button that causes the query to be cleared

loadQueryButtonId
Type:String
Default:“LoadQueryButton”
The ID of the button that initiates the query loading

saveQueryButtonId
Type:String
Default:“SaveQueryButton”
The ID of the button that initiates the query saving

executeQueryButtonId
Type:String
Default:“ExecuteQueryButton”
The ID of the button that causes the query to be executed

exportButtonsId
Type:String
Default:“ResultExportButtons”
The ID of the element that contains buttons for result exporting

Code examples:

  //Settings for EasyQuery pages
  window.easyQueryViewSettings = {
      showChart: false,
      clearQueryButtonId: "myClearButton"
  };

Discussion

Enter your comment: