Page 1 of 1

Not able to search in p-table frozen columns

Posted: 08 Jan 2019, 14:49
by gauravarora
Hi, I am not able to use search filter in frozen table i.e. it's not searching in the frozen columns using filterGlobal($, 'contains'). Is there any way to handle this ?

Re: Not able to search in p-table frozen columns

Posted: 09 Jan 2019, 09:09
by yigitfindikli
Can i see your code ?

Re: Not able to search in p-table frozen columns

Posted: 10 Jan 2019, 07:42
by gauravarora
yigitfindikli wrote:
09 Jan 2019, 09:09
Can i see your code ?
<p-table [value]="departmentItemData" [columns]="selectedColumns" #departmentItemTable [rows]="25" paginatorPosition="bottom"
[rowsPerPageOptions]="[25, 50, 75, 100]" [paginator]="true" (onFilter)="searchDepartmentItems($event)" [scrollable]="true"
class="tableWithfilters frozenTable" styleClass="scrollableTable" [frozenColumns]="frozenCols" frozenWidth="180px"
[reorderableColumns]="true" (onColReorder)="saveColumnsOrder($event)">
<ng-template pTemplate="caption">
<div class="filterBar d-flex w-100 j-space-between">
<div class="filterBar d-flex align-items-center">
<div class="filterBarOptions">
<div class="customSearch">
<input type="text" pInputText placeholder="{{'' | translate}}" class="form-control searchUser"
(keyup)="checkInputLength()" #searchInput (input)="departmentItemTable.filterGlobal($, 'contains')"
<div class="pTableMultiSelect">
<p-multiSelect [options]="cols" [(ngModel)]="selectedColumns" optionLabel="header" maxSelectedLabels="0"
selectedItemsLabel="" (onChange)="onColumnChange($event)" [filter]="false" [disabled]="noDepartmentMsg">
<span *ngIf="selectedColumns.length !== cols.length else default">{{'common.selectAll' | translate}}</span>
<ng-template #default><span>{{'common.removeAll' | translate}}</span></ng-template>
<ng-template pTemplate="colgroup" let-columns>
<col *ngFor="let col of columns" class="scollableTableCol">
<ng-template pTemplate="header" let-columns>
<th *ngFor="let col of columns" [pSortableColumn]="col.field" pReorderableColumn [pReorderableColumnDisabled]="col.header === 'Department'" [class.hiddenColumn] = "col.header === 'Department'">
<p-sortIcon [field]="col.field"></p-sortIcon>
<i class="pi pi-bars" *ngIf="col.header !== 'Department'"></i>
<ng-template pTemplate="body" let-department let-rowIndex="rowIndex" let-columns="columns">
<td *ngFor="let col of columns" [class.hiddenColumn] = "col.header === 'Department'">

<span (click)="redirectToItemPage(col.header, department)"
<ng-template pTemplate="emptymessage" let-department>
<div class="noItemFound">
<p *ngIf="filteredRowLength === 0">{{'common.noResultFound' | translate}}</p>
<p *ngIf="noDepartmentMsg">{{'itemMovement.departmentItems.noDepartmentForDate' | translate}}.</p>

Frozen Col

this.frozenCols = [
{ field: 'name', header: 'Department' }

Scrollable Cols
export const DepartmentItemTableCols = [
{ field: 'netSalesAmt', header: 'Net sales amount' },

I'm not able to search in frozen cols