issue with datatable lazy loading and filter

UI Components for React
Post Reply
Strekkos
Posts: 1
Joined: 12 Feb 2021, 18:24

12 Feb 2021, 18:31

Hello,

I am facing an issue with the DataTable component. When I am using the lazy parameter I can use filters with no problem but when i'm using lazy + filter it's not filtering my table

this way the filter is working fine :

Code: Select all

<div className="card">
                <h5>Virtual Scroll</h5>
                <DataTable
                	value={virtualCustomers}
                	scrollable
                	scrollHeight="200px" 
                	//lazy
                	rows={20}
                	loading={virtualLoading}
                    	virtualScroll
                    	virtualRowHeight={45}
                    	onVirtualScroll={onVirtualScroll}
                    	totalRecords={lazyTotalRecords}>
                    <Column field="name" header="Name" loadingBody={loadingText} filter></Column>
                    <Column field="country.name" header="Country" loadingBody={loadingText}></Column>
                    <Column field="representative.name" header="Representative" loadingBody={loadingText}></Column>
                    <Column field="status" header="Status" loadingBody={loadingText}></Column>
                </DataTable>
 </div>
but this way the filter does not refresh the table:

Code: Select all

<div className="card">
                <h5>Virtual Scroll</h5>
                <DataTable
                	value={virtualCustomers}
                	scrollable
                	scrollHeight="200px" 
                	lazy
                	rows={20}
                	loading={virtualLoading}
                    	virtualScroll
                    	virtualRowHeight={45}
                    	onVirtualScroll={onVirtualScroll}
                    	totalRecords={lazyTotalRecords}>
                    <Column field="name" header="Name" loadingBody={loadingText} filter></Column>
                    <Column field="country.name" header="Country" loadingBody={loadingText}></Column>
                    <Column field="representative.name" header="Representative" loadingBody={loadingText}></Column>
                    <Column field="status" header="Status" loadingBody={loadingText}></Column>
                </DataTable>
 </div>
Do you have any solution or this is a bug ?

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 2 guests