Query class is used to build query which is used by the DataManager to communicate with datasource.
Adds additional parameter which will be sent along with the request which will be generated while DataManager execute.
Parameter | Type | Description |
---|---|---|
key | string |
Defines the key of additional parameter. |
value | Function | string | null |
Defines the value for the key. |
Returns Query
Aggregate the data with given type and field name.
Parameter | Type | Description |
---|---|---|
type | string |
Defines the aggregate type. |
field | string |
Defines the column field to aggregate. |
Returns Query
Creates deep copy of the Query object.
Returns Query
Executes query with the given DataManager.
Parameter | Type | Description |
---|---|---|
dataManager (optional) | DataManager |
Defines the DataManager. |
done (optional) | Function |
Defines the success callback. |
fail (optional) | Function |
Defines the failure callback. |
always (optional) | Function |
Defines the callback which will be invoked on either success or failure.
|
Returns Promise
Executes query with the local datasource.
Parameter | Type | Description |
---|---|---|
dataManager (optional) | DataManager |
Defines the DataManager. |
Returns Object[]
Expands the related table.
Parameter | Type | Description |
---|---|---|
tables | string | Object[] |
Returns Query
Sets the foreign key which is used to get data from the related table.
Parameter | Type | Description |
---|---|---|
key | string |
Defines the foreign key. |
Returns Query
Specifies the name of table to retrieve data in query execution.
Parameter | Type | Description |
---|---|---|
tableName | string |
Defines the table name. |
Returns Query
Groups data with the given field name.
Returns Query
Gets the records in hierarchical relationship from two tables. It requires the foreign key to relate two tables.
Parameter | Type | Description |
---|---|---|
query | Query |
Defines the query to relate two tables. |
selectorFn | Function |
Defines the custom function to select records. |
Returns Query
Gets data based on the given page index and size.
Parameter | Type | Description |
---|---|---|
pageIndex | number |
Defines the current page index. |
pageSize | number |
Defines the no of records per page. |
Returns Query
Gets data based on the given start and end index.
Parameter | Type | Description |
---|---|---|
start | number |
Defines the start index of the datasource. |
end | number |
Defines the end index of the datasource. |
Returns Query
It is used to get total number of records in the DataManager execution result.
Returns Query
Search data with given search criteria.
Parameter | Type | Description |
---|---|---|
searchKey | string | number | boolean |
Defines the search key. |
fieldNames (optional) | string | string[] |
Defines the collection of column fields. |
operator (optional) | string |
Defines the operator how to search data. |
ignoreCase (optional) | boolean |
If ignore case set to false, then filter data with exact match or else filter data with case insensitive. |
ignoreAccent (optional) | boolean |
Returns Query
Selects specified columns from the data source.
Parameter | Type | Description |
---|---|---|
fieldNames | string | string[] |
Defines the collection of column fields. |
Returns Query
Sets the primary key.
Parameter | Type | Description |
---|---|---|
field | string |
Defines the column field. |
Returns Query
Skips data with given number of records count from the top of the data source.
Parameter | Type | Description |
---|---|---|
nos | number |
Defines the no of records skip in the datasource. |
Returns Query
Sort the data with given sort criteria. By default, sort direction is ascending.
Parameter | Type | Description |
---|---|---|
fieldName | string | string[] |
Defines the single or collection of column fields. |
comparer (optional) | string | Function |
Defines the sort direction or custom sort comparer function. |
isFromGroup (optional) | boolean |
Returns Query
Sorts data in descending order.
Parameter | Type | Description |
---|---|---|
fieldName | string |
Defines the column field. |
Returns Query
Sort the data with given sort criteria. By default, sort direction is ascending.
Returns Query
Gets data from the top of the data source based on given number of records count.
Parameter | Type | Description |
---|---|---|
nos | number |
Defines the no of records to retrieve from datasource. |
Returns Query
Sets default DataManager to execute query.
Parameter | Type | Description |
---|---|---|
dataManager | DataManager |
Defines the DataManager. |
Returns Query
Filter data with given filter criteria.
Returns Query