0

I am facing an issue with the DataTable component of primereact. 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 :

<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:

<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 ?

Jasper de Vries
  • 13,693
  • 6
  • 54
  • 86
Hugo dz
  • 35
  • 3

0 Answers0