Saturday, 7 February 2026

dropdownsearch for dyanmic fields

   I’ve enabled searchable dropdowns for all dynamic dropdown controls in Assignment Details.

What I changed

  • Added a dropdownSearch map in assignment-details.component.ts.
  • Added ngx-mat-select-search inside every dynamic dropdown in assignment-details.component.html.
  •    <ng-template #dynamicOptions>
  •       <mat-option>
  •         <ngx-mat-select-search
  •           [(ngModel)]="dropdownSearch[field.ControlName]"
  •           [ngModelOptions]="{ standalone: true }"
  •           [placeholderLabel]="'Search...'"
  •           [noEntriesFoundLabel]="'Not found'"
  •         ></ngx-mat-select-search>
  •       </mat-option>
  •       <mat-option
  •         *ngFor="
  •           let option of field.Options
  •             | stringFilterBy: dropdownSearch[field.ControlName]:'Name'
  •         "
  •         [value]="option.Value"
  •       >
  •         {{ option.Name }}
  •       </mat-option>
  •     </ng-template>
  • Wired filtering using the existing stringFilterBy pipe on option.Name.

private destroy$ = new Subject<void>();

dropdownSearch: Record<string, string> = {};

No comments:

Post a Comment

dropdownsearch for dyanmic fields

    I’ve enabled searchable dropdowns for all dynamic dropdown controls in Assignment Details. What I changed Added a  dropdownSearch  map...