Table of Contents

EQ.client namespace

Contains several functions which help initilize and manage EasyQuery widgets and simplify the communications with server-side code.

Functions

init

Initializes all EasyQuery objects and widgets.
options
Type:PlainObject
A map of options to pass to EasyQuery core objects and widgets.
serviceUrl
Type:String

an URL (absolute or relative) to the back-end service or controller which implements basic EasyQuery actions

modelName
Type:String

the name of the data model which will be automatically during initialization;

columnsPanel
Type:PlainObject

A map of different options for ColumnsPanel widget.

Example:

EQ.client.init({
serviceUrl: "EQService.asmx",
modelName: "nwind",
columnsPanel: { allowAggrColumns: true, attrElementFormat: "{attr}", showColumnCaptions: false  },
queryPanel: { listRequestHandler: onListRequest }
});


loadModel

Sends a “LoadModel” requests to the server and processes the response.
options
Type:PlainObject
A map of options to pass to buildQuery function.
modelName
Type:String

The name of data model to load.

success
Type:Function
The function that is called on successfull model loading. Loaded model object is passed in function's parameter
beforeSend
Type:Function

A function that is called before BuildQuery request call.


loadQuery

Sends a “LoadQuery” request to the server and processes the response.
options
Type:PlainObject
A map of options to pass to buildQuery function.
queryName
Type:String

The name of query to load.

success
Type:Function

A function that is called on successfull query build. Loaded query is passed in function parameter

beforeSend
Type:Function

A function that is called before BuildQuery request call.


clearQuery

Clears all conditions and columns in the current query.


saveQuery

Sends “SaveQuery” request to the server and processes the response.
options
Type:PlainObject
A map of options to pass to SaveQuery function.
query
Type:PlainObject

An object that represents query to save.

queryName
Type:String

The name of the query

success
Type:Function

A function that is called on successfull query saving.

beforeSend
Type:Function

A function that is called before SaveQuery request call.


buildQuery

Sends “BuildQuery” request to the server and processes the response.
params
Type:PlainObject
A map of parameters to pass to buildQuery function.
query
Type:PlainObject

An object that represents query to build.

extraParams
Type:String

A string that represents extra parameters which are added to the request

success
Type:Function

A function that is called on successfull query build. This function takes one parameter which contains genereated statement in “statement” property or the error message in “error” property if some problem occurred during query building process.

beforeSend
Type:Function

A function that is called before BuildQuery request call.


buildAndExecute

Sends “ExecuteQuery” request to the server and processes the response.
params
Type:PlainObject
A map of parameters to pass to buildQuery function.
query
Type:PlainObject

An object that represents query to build and execute.

extraParams
Type:String

A string that represents extra parameters which are added to the request

success
Type:Function

A function that is called on successfull query build. This function takes one parameter “data” - a plain object which contains genereated statement in its “statement” property and the result of query execution in “resultSet” property.

beforeSend
Type:Function

A function that is called before BuildQuery request call.