Hello!
I'm italian, I manage a basic english.
I need to know how to capture the filtered event of a p-dataview element, that is, do something just when this.dataview.filter() has finished its work! Can anyone help me?
How to capture p-dataview filtered event
Ciao:
I replaced the filter method with my method, then I called the DataView's method from my method as follows:
As seen below:
Then in typescript:
I replaced the filter method with my method, then I called the DataView's method from my method as follows:
Code: Select all
(input)="Myfilter($event.target.value)"
Code: Select all
<div class="card">
<p-dataView #dv [value]="products" [paginator]="true" [rows]="9" filterBy="name"
[sortField]="sortField" [sortOrder]="sortOrder" layout="grid">
<ng-template pTemplate="header">
<div class="p-d-flex p-flex-column p-flex-md-row p-jc-md-between">
<p-dropdown [options]="sortOptions" [(ngModel)]="sortKey" placeholder="Sort By Price" (onChange)="onSortChange($event)" styleClass="p-mb-2 p-mb-md-0"></p-dropdown>
<span class="p-input-icon-left p-mb-2 p-mb-md-0">
<i class="pi pi-search"></i>
<input type="search" pInputText placeholder="Search by Name" (input)="Myfilter($event.target.value)">
</span>
<p-dataViewLayoutOptions></p-dataViewLayoutOptions>
</div>
</ng-template>
Code: Select all
import { DataView } from 'primeng/dataview';
...
@ViewChild( 'dv' ) dv: DataView;
...
Myfilter(filter: string, filterMatchMode:string = "contains" ) {
this.dv.filter( filter, filterMatchMode );
// free to do anything here
}
Is there a DataView equivalent for IList? I had a DataTable that fed into several filtered DataViews which fed into several DataGridViews. After getting everything working, come to find out DataTables are 20 year old technology that shouldnt be 192.168.100.1 192.168.1.1 used.
Hey,
Try
It also supports lazy.
Try
https://www.primefaces.org/primeng/show ... alscrollerVirtualScroller is an efficient way of rendering lists by displaying a small subset of data in the viewport at any time.
It also supports lazy.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 17 guests