Row count after filter

UI Components for React
Post Reply
kwilhelm1
Posts: 5
Joined: 04 Jun 2019, 02:24

19 Jun 2019, 06:27

Probably asked a million times guys... I can console.log the new filtered record count but every time I try to setState I get the "max loops" error in ReactJS because the DT re-renders...

I really REALLY need the # of recs // not pages // after a filter

Suggestions?

Thanks kindly!

User avatar
aragorn
Posts: 3641
Joined: 29 Jun 2013, 12:38

24 Jun 2019, 09:31

Hi,

Could you please attach a codesandbox link for us? Also, do you use onFilter method to calculate row counts? Please see; https://www.primefaces.org/primereact/#/datatable

You can use https://codesandbox.io/s/qjx332qq4 to provide the sample.

Best Regards,

kwilhelm1
Posts: 5
Joined: 04 Jun 2019, 02:24

24 Jun 2019, 19:06

Here ya go: https://codesandbox.io/s/primereact-tes ... ontsize=14

I know the {this.state.totalRecords} is incorrect for the filteredCount.

I see in the source for DataTable.js for method processData(localState) {} line 1080 (before the return data) if I console.log(data.length) the filteredCount is there but it never manifests itself anywhere else.

How can I use that for my filteredRecord count?

Thank you very much for your time & help with this

kwilhelm1
Posts: 5
Joined: 04 Jun 2019, 02:24

31 Jul 2019, 20:47

well I suppose the answer is... do it my damn self

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest