Search results

QueryBuilderComponent

Represents the EJ2 Angular QueryBuilder Component.

<ejs-querybuilder></ejs-querybuilder>

Properties

allowValidation

boolean

Enables or disables the validation.

Defaults to false

columns

ColumnsModel[]

Specifies columns to create filters.

Defaults to {}

cssClass

string

Defines class or multiple classes, which are separated by a space in the QueryBuilder element. You can add custom styles to the QueryBuilder using the cssClass property.

Defaults to

dataSource

Object[] | Object | DataManager

Binds the column name from data source in query-builder. The dataSource is an array of JavaScript objects.

Defaults to []

displayMode

string

Specifies the displayMode as Horizontal or Vertical.

Defaults to ‘Horizontal’

enablePersistence

boolean

Enable or disable persisting component’s state between page reloads. If enabled, filter states will be persisted.

Defaults to false.

enableRtl

boolean

Enables or disables the RTL support it is extended from the component class.

Defaults to false.

height

string

Specifies the height of the query builder.

Defaults to ‘auto’

locale

string

Overrides the global culture and localization value for this component. Default global culture is ‘en-US’.

Defaults to

matchCase

boolean

If match case is set to true, the grid filters the records with exact match. if false, it filters case insensitive records (uppercase and lowercase letters treated the same).

Defaults to false

maxGroupCount

number

Specifies the maximum group count or restricts the group count.

Defaults to 5

rule

RuleModel

Defines rules in the QueryBuilder. Specifies the initial rule, which is JSON data.

Defaults to {}

showButtons

ShowButtonsModel

Specifies the showButtons settings of the query builder component. The showButtons can be enable Enables or disables the ruleDelete, groupInsert, and groupDelete buttons.

Defaults to { ruleDelete: true , groupInsert: true, groupDelete: true }

sortDirection

string

Specifies the sort direction of the field names.

Defaults to ‘Default’

summaryView

boolean

Shows or hides the filtered query.

Defaults to false

width

string

Specifies the width of the query builder.

Defaults to ‘auto’

Methods

addGroups

Adds single or multiple groups, which contains the collection of rules.

Returns void

addRules

Adds single or multiple rules.

Returns void

deleteGroups

Deletes the group or groups based on the group ID.

Returns void

deleteRules

Deletes the rule or rules based on the rule ID.

Returns void

destroy

Removes the component from the DOM and detaches all its related event handlers. Also it maintains the initial input element from the DOM.

Returns void

getDataManagerQuery

Gets the query for Data Manager.

Returns Query

getFilteredRecords

return the Query from current rules collection.

Returns Promise

getGroup

Gets the group.

Returns RuleModel

getPredicate

Get the predicate from collection of rules.

Returns Predicate

getRule

Gets the rule.

Returns RuleModel

getRules

Gets the rule or rule collection.

Returns RuleModel

getRulesFromSql

Get the rules from SQL query.

Returns RuleModel

getSqlFromRules

Gets the sql query from rules.

Returns string

getValidRules

return the valid rule or rules collection.

Returns RuleModel

reset

Clears the rules without root rule.

Returns void

setRules

Set the rule or rules collection.

Returns void

setRulesFromSql

Sets the rules from the sql query.

Returns void

validateFields

Validate the conditions and it display errors for invalid fields.

Returns boolean

Events

beforeChange

EmitType<ChangeEventArgs>

Triggers before the condition (And/Or), field, operator, value is changed.

change

EmitType<ChangeEventArgs>

Triggers when changing the condition(AND/OR), field, value, operator is changed

created

EmitType<Event>

Triggers when the component is created.

ruleChange

EmitType<RuleChangeEventArgs>

Triggers when changing the condition(AND/OR), field, value, operator is changed