Query class
Represents Query.
- addChangedCallback
- addColumn
- addPredicate
- addProcessCallback
- addSimpleCondition
- beginUpdate
- clear
- clearColumns
- clearConditions
- endUpdate
- fireChangedEvent
- fireProcessEvent
- getColumnSortIndex
- getColumns
- getConditionsText
- getDescription
- getId
- getModel
- getName
- getOneValueForAttr
- getRootPredicate
- getSortedColumns
- isEmptyColumns
- isEmptyConditions
- loadFromJson
- loadModelData
- moveColumn
- removeChangedCallback
- removeColumn
- removeColumns
- removeProcessCallback
- runThroughConditions
- setData
- setDescription
- setId
- setModel
- setName
- toJSON
- toJSONData
Constructors
Section titled “Constructors”constructor
Section titled “constructor”The default constructor. ⊕ new Query(model?: DataModel,data?: QueryData,options?: QueryOptions): Query
Parameters:
Section titled “Parameters:”- model: DataModel, Optional - The data model.
- data: QueryData, Optional - JSON representation object.
- options: QueryOptions, Optional - The options.
Public Properties
Section titled “Public Properties”attrClassName
Section titled “attrClassName”The attributec class name (Tag).
● attrClassName: ExprTag
clientListRequestHandler
Section titled “clientListRequestHandler”● clientListRequestHandler: any
The Data Model associated with this query.
● model: DataModel
serverListRequestHandler
Section titled “serverListRequestHandler”● serverListRequestHandler: any
Public Methods
Section titled “Public Methods”addChangedCallback
Section titled “addChangedCallback”Add changed callback
▸ addChangedCallback(callback: (event: EqEvent) => void
): string
Parameters:
Section titled “Parameters:”- callback: (event: EqEvent) =>
void
- The callback ID.
Returns string
addColumn
Section titled “addColumn”Adds a new column with specified index.
▸ addColumn(column: Column | Column[],index: any
,author: any
): void
Parameters:
Section titled “Parameters:”- column: Column | Column[] - The column or array of columns
- index:
any
- The index of new column - author:
any
- The author.
Returns void
Example:
Section titled “Example:”const column = new Column();column.caption = "Company name";
query.addColumn(column, 1)
addPredicate
Section titled “addPredicate”Adds a new predicate.
▸ addPredicate(params: any
): Condition
Parameters:
Section titled “Parameters:”- params:
any
- The options.
Returns Condition
addProcessCallback
Section titled “addProcessCallback”Add process callback
▸ addProcessCallback(callback: (event: EqEvent) => void
): string
Parameters:
Section titled “Parameters:”- callback: (event: EqEvent) =>
void
- The callback.
Returns string
addSimpleCondition
Section titled “addSimpleCondition”Adds a new simple condition.
▸ addSimpleCondition(params: any
): Condition
Parameters:
Section titled “Parameters:”- params:
any
- The options.
Returns Condition
beginUpdate
Section titled “beginUpdate”Begin update. Set event emitter to silent mode.
▸ beginUpdate(): void
Returns void
Clears query (all conditions and columns).
▸ clear(silent?: boolean
): void
Parameters:
Section titled “Parameters:”- silent:
boolean
, Default value =false
- Indicate wether clear query without firing event.
Returns void
clearColumns
Section titled “clearColumns”Clears all columns in query
▸ clearColumns(): void
Returns void
clearConditions
Section titled “clearConditions”Clears all conditions in query.
▸ clearConditions(): void
Returns void
endUpdate
Section titled “endUpdate”Begin update. Remove silent mode.
▸ endUpdate(raiseChangeEvent?: boolean
): void
Parameters:
Section titled “Parameters:”- raiseChangeEvent:
boolean
, Default value =false
Returns void
fireChangedEvent
Section titled “fireChangedEvent”Fires change event.
▸ fireChangedEvent(data: any
,postpone?: number
): void
Parameters:
Section titled “Parameters:”- data:
any
- The data. - postpone:
number
, Default value =100
- The postpone.
Returns void
fireProcessEvent
Section titled “fireProcessEvent”Fires process event.
▸ fireProcessEvent(data: any
): void
Parameters:
Section titled “Parameters:”- data:
any
- The data.
Returns void
getColumnSortIndex
Section titled “getColumnSortIndex”Gets Colummn sorting index.
▸ getColumnSortIndex(col: Column): number
Parameters:
Section titled “Parameters:”- col: Column - The column.
Returns number
getColumns
Section titled “getColumns”Get array of columns.
▸ getColumns(): Column[]
Returns Column[]
getConditionsText
Section titled “getConditionsText”Retruns conditions text
▸ getConditionsText(): string
Returns string
getDescription
Section titled “getDescription”Gets description of the query.
▸ getDescription(): string
Returns string
Gets query ID.
▸ getId(): string
Returns string
- The ID>
getModel
Section titled “getModel”Gets DataModel object associated with this query.
▸ getModel(): DataModel
Returns DataModel
getName
Section titled “getName”Gets name of the query.
▸ getName(): string
Returns string
getOneValueForAttr
Section titled “getOneValueForAttr”Gets one value for the attribute
▸ getOneValueForAttr(attrId: string
): string
Parameters:
Section titled “Parameters:”- attrId:
string
- The attribute ID.
Returns string
getRootPredicate
Section titled “getRootPredicate”Gets root predicate
▸ getRootPredicate(): Condition
Returns Condition
getSortedColumns
Section titled “getSortedColumns”Gets array of columns used in sorting
▸ getSortedColumns(): Column[]
Returns Column[]
isEmptyColumns
Section titled “isEmptyColumns”Checks wether query does not contains any column.
▸ isEmptyColumns(): boolean
Returns boolean
isEmptyConditions
Section titled “isEmptyConditions”Checks wether query does not contains any condtion.
▸ isEmptyConditions(): boolean
Returns boolean
loadFromJson
Section titled “loadFromJson”Loads query from JSON.
▸ loadFromJson(json: string
): void
Parameters:
Section titled “Parameters:”- json:
string
- The JSON string.
Returns void
loadModelData
Section titled “loadModelData”Loads data model.
▸ loadModelData(model: DataModelData | string
): void
Parameters:
Section titled “Parameters:”- model: DataModelData |
string
- JSON representation object or JSON string.
Returns void
moveColumn
Section titled “moveColumn”Moves the column with specified index to another position.
▸ moveColumn(index1: number
,index2: number
,author: any
): void
Parameters:
Section titled “Parameters:”- index1:
number
- The index of the column that should be moved. - index2:
number
- The index of the position the column should be moved to - author:
any
- The author
Returns void
removeChangedCallback
Section titled “removeChangedCallback”Remove changed callback
▸ removeChangedCallback(callbackId: string
): void
Parameters:
Section titled “Parameters:”- callbackId:
string
- The callback ID.
Returns void
removeColumn
Section titled “removeColumn”Removes the column.
▸ removeColumn(column: Column,author: any
): void
Parameters:
Section titled “Parameters:”- column: Column - The column to be removed.
- author:
any
- The author
Returns void
removeColumns
Section titled “removeColumns”Removes several columns passed as array.
▸ removeColumns(columnsToRemove: Column[],author: any
): void
Parameters:
Section titled “Parameters:”- columnsToRemove: Column[] - The list of columns to be removed.
- author:
any
- The author.
Returns void
removeProcessCallback
Section titled “removeProcessCallback”Remove process callback
▸ removeProcessCallback(callbackId: string
): void
Parameters:
Section titled “Parameters:”- callbackId:
string
- The callback ID.
Returns void
runThroughConditions
Section titled “runThroughConditions”Runs through condition with this callback.
▸ runThroughConditions(processCondition: (cond: Condition) => void
): void
Parameters:
Section titled “Parameters:”- processCondition: (cond: Condition) =>
void
- The function to process condition.
Returns void
setData
Section titled “setData”Sets data to the query.
▸ setData(data: QueryData | string
,silent?: boolean
): void
Parameters:
Section titled “Parameters:”- data: QueryData |
string
- JSON representation object or JSON string - silent:
boolean
, Default value =false
- Indicate wether to set data silent (without firing event)
Returns void
setDescription
Section titled “setDescription”Sets description of the query
▸ setDescription(description: string
): void
Parameters:
Section titled “Parameters:”- description:
string
- New description.
Returns void
Sets query ID.
▸ setId(id: string
): void
Parameters:
Section titled “Parameters:”- id:
string
- New Query ID.
Returns void
setModel
Section titled “setModel”Sets DataModel object associated with this query.
▸ setModel(model: DataModel): void
Parameters:
Section titled “Parameters:”- model: DataModel - The data model.
Returns void
setName
Section titled “setName”Sets name of the query
▸ setName(name: string
): void
Parameters:
Section titled “Parameters:”- name:
string
- New name.
Returns void
toJSON
Section titled “toJSON”Returns JSON representation of this query.
▸ toJSON(): string
Returns string
toJSONData
Section titled “toJSONData”Returns JSON representation of this query.
▸ toJSONData(): QueryData
Returns QueryData