File

core/data-grid/column/filtering-form-renderer.component.ts

Implements

OnChanges

Metadata

Index

Properties
Methods
Inputs
Accessors

Constructor

constructor(injector: Injector, cd: ChangeDetectorRef)
Parameters :
Name Type Optional
injector Injector No
cd ChangeDetectorRef No

Inputs

spec
Type : FilteringFormRendererSpec

Methods

ngOnChanges
ngOnChanges()
Returns : void

Properties

defaultRendererFilterText
Type : string
Default value : ''
rendererInjector
Type : Injector
rendererType
Type : "TEMPLATE" | "COMPONENT"
spec
Type : FilteringFormRendererSpec

Accessors

_spec
set_spec(spec: FilteringFormRendererSpec)
Parameters :
Name Type Optional
spec FilteringFormRendererSpec No
Returns : void
<ng-container *ngIf="spec.renderer">
  <ng-container
    *ngIf="rendererType === 'TEMPLATE'"
    [ngTemplateOutlet]="spec.renderer"
    [ngTemplateOutletContext]="{ $implicit: spec.context }"
  ></ng-container>

  <ng-container
    *ngIf="rendererType === 'COMPONENT'"
    [c8yComponentOutlet]="spec.renderer"
    [c8yComponentOutletInjector]="rendererInjector"
  ></ng-container>
</ng-container>

<ng-container *ngIf="!spec.renderer">
  <div class="form-group p-t-8">
    <label>{{ 'Filter text' | translate }}</label>
    <input
      class="form-control"
      [(ngModel)]="defaultRendererFilterText"
      (keyup.enter)="
        spec.context.applyFilter({
          filterPredicate: defaultRendererFilterText
        })
      "
    />
  </div>

  <div class="data-grid__dropdown__footer d-flex separator-top">
    <button
      title="{{ 'Reset' | translate }}"
      class="btn btn-default btn-sm flex-grow m-r-8"
      (click)="defaultRendererFilterText = ''; spec.context.resetFilter()"
    >
      {{ 'Reset' | translate }}
    </button>
    <button
      title="{{ 'Apply' | translate }}"
      class="btn btn-primary btn-sm flex-grow"
      (click)="
        spec.context.applyFilter({
          filterPredicate: defaultRendererFilterText
        })
      "
    >
      {{ 'Apply' | translate }}
    </button>
  </div>
</ng-container>

results matching ""

    No results matching ""