0

p-table的全局过滤器有问题?我有一些记录,当我搜索“test.txt”(全名)时,它会正确过滤,但如果我搜索“test”,它不会过滤内容,而是包含一些没有匹配搜索词的记录。

我的代码:


    <p-table 
      #dt
      [columns]="selectedColumns"
      [value]="jobList"
      [(selection)]="selectedJob"
      (onRowSelect)="onRowSelect($event)"
      columnResizeMode="expand"
      [resizableColumns]="true"
      [autoLayout]="true"
      [rows]="10"
      selectionMode="single"
      [paginator]="true"
      [pageLinks]="3"
      [rowsPerPageOptions]="[5,10,15,20,50,100]"
      [metaKeySelection]="true"
      (sortFunction)="sortColumn($event)"
      [customSort]="true"
      sortField="createdOn"
      [sortOrder]="-1"
      [style]="{'padding-right':'13px','padding-bottom':'13px' }"
    >
      <ng-template pTemplate="caption">
        <div class="table">
          <div class="row">
            <div class="leftcell">
              <i class="fa fa-search" style="margin:4px 4px 0 0"></i>
              <input
                type="text"
                pInputText
                [(ngModel)]="dtinput"
                size="25"
                placeholder="Search"
                (input)="dt.filterGlobal($event.target.value, 'contains')"
                class="search-style"
              >
              &nbsp;
              <button
                pButton
                type="button"
                (click)="resetfilter()"
                label="Clear Filter"
              ></button>
              &nbsp;
            </div>
            <div class="rightcell">
              ...
            </div>
          </div>
        </div>
        ....
4

0 回答 0