Search results

Predicate API in JavaScript (ES5) DataManager API control

Predicate class is used to generate complex filter criteria. This will be used by DataManager to perform multiple filtering operation.

Methods

and

Adds new predicate on existing predicate with “and” condition.

Returns Predicate

andnot

Adds new predicate on existing predicate with “and not” condition.

Returns Predicate

or

Adds new predicate on existing predicate with “or” condition.

Returns Predicate

ornot

Adds new predicate on existing predicate with “and not” condition.

Returns Predicate

toJson

Converts predicates to plain JavaScript. This method is uses Json stringify when serializing Predicate object.

Returns Object

validate

Validate the record based on the predicates.

Parameter Type Description
record Object Defines the datasource record.

Returns boolean

and

Adds n-number of new predicates on existing predicate with “and” condition.

Parameter Type Description
args Object[] Defines the collection of predicates.

Returns Predicate

andnot

Adds n-number of new predicates on existing predicate with “and not” condition.

Parameter Type Description
args Object[] Defines the collection of predicates.

Returns Predicate

fromJson

Converts plain JavaScript object to Predicate object.

Parameter Type Description
json Predicate[] | Predicate Defines single or collection of Predicate.

Returns Predicate[]

or

Adds n-number of new predicates on existing predicate with “or” condition.

Parameter Type Description
args Object[] Defines the collection of predicates.

Returns Predicate

ornot

Adds n-number of new predicates on existing predicate with “and not” condition.

Parameter Type Description
args Object[] Defines the collection of predicates.

Returns Predicate