Skip to content

Query class

Represents Query.


The default constructor. ⊕ new Query(model?: DataModel,data?: QueryData,options?: QueryOptions): Query



The attributec class name (Tag).

● attrClassName: ExprTag


● clientListRequestHandler: any


The Data Model associated with this query.

● model: DataModel


● serverListRequestHandler: any



Add changed callback

▸ addChangedCallback(callback: (event: EqEvent) => void): string

  • callback: (event: EqEvent) => void - The callback ID.

Returns string


Adds a new column with specified index.

▸ addColumn(column: Column | Column[],index: any,author: any): void

  • column: Column | Column[] - The column or array of columns
  • index: any - The index of new column
  • author: any - The author.

Returns void

const column = new Column();
column.caption = "Company name";
query.addColumn(column, 1)

Adds a new predicate.

▸ addPredicate(params: any): Condition

  • params: any - The options.

Returns Condition


Add process callback

▸ addProcessCallback(callback: (event: EqEvent) => void): string

  • callback: (event: EqEvent) => void - The callback.

Returns string


Adds a new simple condition.

▸ addSimpleCondition(params: any): Condition

  • params: any - The options.

Returns Condition


Begin update. Set event emitter to silent mode.

▸ beginUpdate(): void

Returns void


Clears query (all conditions and columns).

▸ clear(silent?: boolean): void

  • silent: boolean, Default value = false - Indicate wether clear query without firing event.

Returns void


Clears all columns in query

▸ clearColumns(): void

Returns void


Clears all conditions in query.

▸ clearConditions(): void

Returns void


Begin update. Remove silent mode.

▸ endUpdate(raiseChangeEvent?: boolean): void

  • raiseChangeEvent: boolean, Default value = false

Returns void


Fires change event.

▸ fireChangedEvent(data: any,postpone?: number): void

  • data: any - The data.
  • postpone: number, Default value = 100 - The postpone.

Returns void


Fires process event.

▸ fireProcessEvent(data: any): void

  • data: any - The data.

Returns void


Gets Colummn sorting index.

▸ getColumnSortIndex(col: Column): number

Returns number


Get array of columns.

▸ getColumns(): Column[]

Returns Column[]


Retruns conditions text

▸ getConditionsText(): string

Returns string


Gets description of the query.

▸ getDescription(): string

Returns string


Gets query ID.

▸ getId(): string

Returns string - The ID>


Gets DataModel object associated with this query.

▸ getModel(): DataModel

Returns DataModel


Gets name of the query.

▸ getName(): string

Returns string


Gets one value for the attribute

▸ getOneValueForAttr(attrId: string): string

  • attrId: string - The attribute ID.

Returns string


Gets root predicate

▸ getRootPredicate(): Condition

Returns Condition


Gets array of columns used in sorting

▸ getSortedColumns(): Column[]

Returns Column[]


Checks wether query does not contains any column.

▸ isEmptyColumns(): boolean

Returns boolean


Checks wether query does not contains any condtion.

▸ isEmptyConditions(): boolean

Returns boolean


Loads query from JSON.

▸ loadFromJson(json: string): void

  • json: string - The JSON string.

Returns void


Loads data model.

▸ loadModelData(model: DataModelData | string): void

  • model: DataModelData | string - JSON representation object or JSON string.

Returns void


Moves the column with specified index to another position.

▸ moveColumn(index1: number,index2: number,author: any): void

  • 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


Remove changed callback

▸ removeChangedCallback(callbackId: string): void

  • callbackId: string - The callback ID.

Returns void


Removes the column.

▸ removeColumn(column: Column,author: any): void

  • column: Column - The column to be removed.
  • author: any - The author

Returns void


Removes several columns passed as array.

▸ removeColumns(columnsToRemove: Column[],author: any): void

  • columnsToRemove: Column[] - The list of columns to be removed.
  • author: any - The author.

Returns void


Remove process callback

▸ removeProcessCallback(callbackId: string): void

  • callbackId: string - The callback ID.

Returns void


Runs through condition with this callback.

▸ runThroughConditions(processCondition: (cond: Condition) => void): void

  • processCondition: (cond: Condition) => void - The function to process condition.

Returns void


Sets data to the query.

▸ setData(data: QueryData | string,silent?: boolean): void

  • 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


Sets description of the query

▸ setDescription(description: string): void

  • description: string - New description.

Returns void


Sets query ID.

▸ setId(id: string): void

  • id: string - New Query ID.

Returns void


Sets DataModel object associated with this query.

▸ setModel(model: DataModel): void

Returns void


Sets name of the query

▸ setName(name: string): void

  • name: string - New name.

Returns void


Returns JSON representation of this query.

▸ toJSON(): string

Returns string


Returns JSON representation of this query.

▸ toJSONData(): QueryData

Returns QueryData