Table of Contents

EQ.core namespace

Contains different functions for managing core EasyQuery objects: data model, query, entities, attributes, operators, etc.

Functions

getEntityAttrById

Returns:An attribute object or null if not found.
Gets entity attribute by its ID. This function runs through all attributes inside specified entity and all its sub-entities.
entity
Type:PlainObject

Entity object to search in

attrId
Type:String

Attribute ID


getAttributById

Returns:An attribute object or null if not found.
Gets entity attribute by its ID. This function runs through all attributes inside specified model (it's root entity and all its sub-entities).
entity
Type:PlainObject

Data model to search in.

attrId
Type:String

Attribute ID


findOperatorById

Returns:An operator object or null if not found.
Finds operator in model by its ID. This function runs through all operators inside specified model and returns the one with specified ID.
entity
Type:PlainObject

Data model to search in.

operatorId
Type:String

Operator ID


getOperatorById

Returns:An operator object with indicated ID or special NullOperator object if not found.
Finds operator in model by its ID. This function runs through all operators inside specified model and returns the one with specified ID.
entity
Type:PlainObject

Data model to search in.

operatorId
Type:String

Operator ID


queryChanged

Adds or removes a handler for “query changed” event.
callback
Type:Function

A function that will be called when the query is changed.

remove
Type:Boolean

Set this parameter to true if you want to remove the handler. Otherwise - false (or don't use it)


getUICAttributeFromEntity

Returns:An attribute object or null if not found.
Gets first “UIC” attribute in specified entity (UIC stands for “use in conditions” - so such attribute can be used in conditions)
entity
Type:PlainObject

Entity object to search our attribute in.