Devextreme-reactive: How to get filtered row count

Created on 11 Apr 2018  路  7Comments  路  Source: DevExpress/devextreme-reactive

Hi,

How do I get row count of filtered items?
In documents i found that IntegratedFiltering has getter 'rows' but how can i access it?

Grid question

Most helpful comment

@pbalzano91
This sample demonstrates how to show a row count. Here I created the TableRowCounter plugin that implements the described functionality.

All 7 comments

Hi,

Would you please clarify your use case? The getter you pointed is helpful for plugin development and available in the TemplateConnector component, for instance.

FYI: the similar question is discussed here.

Using the TemplateConnector, how can you set an internal state? Use case: display number of filtered rows outside table

@pbalzano91
This sample demonstrates how to show a row count. Here I created the TableRowCounter plugin that implements the described functionality.

That was exactly what I was looking for. I could wrap my Toolbar plugin and manage that state. Thank you!

Thank you @SergeyAlexeev !! But darn, this appears to only show the row count of the visible rows. When paging is turned on for the table its just displaying the count on the first page, see my modified version of your sample: https://codesandbox.io/s/z68v3njjrp

Ack! nevermind, I answered my own question, instead of using rows.length in TableRowCounter use totalCount, i.e.

<TemplateConnector> {({ totalCount }) => { return ( <React.Fragment> <div>Row count: <strong>{totalCount }</strong></div> <Paper> <TemplatePlaceholder /> </Paper> </React.Fragment> ); }} </TemplateConnector>

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests.

Was this page helpful?
0 / 5 - 0 ratings