← DataGrid API

Component · v2.6.0

NgbAdvancedSearchComponent

Reusable advanced search builder that emits DataGrid filter descriptors.

Import

import { NgbAdvancedSearchComponent } from '@angular-bootstrap/ngbootstrap';

Selector:ngb-advanced-search

Declaration

Inputs

fields

set fields(value: NgbAdvancedSearchField[] | null | undefined) get fields(): NgbAdvancedSearchField[]

operators

set operators(value: NgbAdvancedSearchOperator[] | null | undefined) get operators(): NgbAdvancedSearchOperator[] | null

rules

Default:[]

logic

logic: 'and' | 'or'

Default:'and'

minRules

minRules: number

Default:1

matchLabel

matchLabel: string

Default:'Match'

rulesLabel

rulesLabel: string

Default:'of the following rules'

whenLabel

whenLabel: string

Default:'When'

addRuleLabel

addRuleLabel: string

Default:'+ Add Rule'

applyLabel

applyLabel: string

Default:'Search'

removeRuleLabel

removeRuleLabel: string

Default:'Remove'

removeRuleAriaLabel

removeRuleAriaLabel: string

Default:'Remove rule'

fieldAriaLabel

fieldAriaLabel: string

Default:'Search field'

operatorAriaLabel

operatorAriaLabel: string

Default:'Search operator'

valueAriaLabel

valueAriaLabel: string

Default:'Search value'

valuePlaceholder

valuePlaceholder: string

Default:'Value...'

Outputs

rulesChange

rulesChange: EventEmitter<NgbAdvancedSearchRule[]>

logicChange

logicChange: EventEmitter<"and" | "or">

filterChange

filterChange: EventEmitter<NgbCompositeFilterDescriptor>

Methods

setLogic

setLogic(logic: 'and' | 'or'): void

addRule

addRule(): void

removeRule

removeRule(index: number): void

apply

apply(): void

emitRules

emitRules(): void

setRuleField

setRuleField(rule: NgbAdvancedSearchRule, field: string): void

setRuleOperator

setRuleOperator(rule: NgbAdvancedSearchRule, operator: NgbFilterOperator): void

inputType

inputType(rule: NgbAdvancedSearchRule): string

operatorRequiresValue

operatorRequiresValue(operator: NgbFilterOperator): boolean

operatorOptionsFor

toFilterDescriptor

toFilterDescriptor(): NgbCompositeFilterDescriptor

Referenced types

Source: src/datagrid/src/search/advanced-search.component.ts in the installed @angular-bootstrap/ngbootstrap package. Angular compiler metadata and private members are omitted.

This project is not affiliated with ng-bootstrap or ngx-bootstrap. Those projects focus mainly on Bootstrap components for Angular. ngbootstrap focuses on Angular UI for data-heavy apps, especially Data Grid, Angular-native Form Builder, drag and drop workflows, documentation examples, and performance-focused Angular patterns.