search results or search result count - ngx-treeview

70 views Asked by At

I am using a ngx-treeview with custom headerTemplate. I want to disable the select all input when the search results are empty. From the treeview template i can get the config & the item.

<ng-template #headerTemplate
             let-item="item"
             let-config="treeViewCategoryConfig"
             let-onCheckedChange="onCheckedChange "
             let-onFilterTextChange="onFilterTextChange">
  <div *ngIf="treeViewCategoryConfig.hasFilter">
    <input type="search"
           [(ngModel)]="filter"
           (ngModelChange)="onFilterTextChange($event)"
           #filterCategory />
  </div>
  <div>
    <input type="checkbox"
           value=""
           [ngModel]="checked"
           (ngModelChange)="onModelChange($event)"
           [id]="checkboxId" />
    <label class="form-check-label"
           [for]="checkboxId">
        {{label}}
    </label>
  </div>
</ng-template>
export interface TreeviewHeaderTemplateContext {
    config: TreeviewConfig;
    item: TreeviewItem;
    onCollapseExpand: () => void;
    onCheckedChange: (checked: boolean) => void;
    onFilterTextChange: (text: string) => void;
}

ngx-treeview emits the selected values from selectedChange event but not the search results. onFilterTextChange method performs the search but returns void.

0

There are 0 answers