Material-table: how to get rows or data after filtering?

Created on 4 Jul 2019  路  4Comments  路  Source: mbrn/material-table

how to get rows or data after filtering?

help wanted wontfix

Most helpful comment

callback what function?
Exemple:

data={[
          { name: 'Mehmet', surname: 'Baran', birthYear: 1987, birthCity: 63 },
          { name: 'Zerya Bet眉l', surname: 'Baran', birthYear: 2017, birthCity: 34 },
         { name: 'name Test', surname: 'Test', birthYear: 2017, birthCity: 34 },
        ]}  

In the filter column 'birthCity' i come in with '34'.
The grid render the two records with 'birthCity: 34'.
I want to get the result containing two records.

Result:{[
{ name: 'Zerya Bet眉l', surname: 'Baran', birthYear: 2017, birthCity: 34 },
{ name: 'name Test', surname: 'Test', birthYear: 2017, birthCity: 34 },
]}

All 4 comments

What do you mean by "get rows or data"? You get them in the data callback function.

callback what function?
Exemple:

data={[
          { name: 'Mehmet', surname: 'Baran', birthYear: 1987, birthCity: 63 },
          { name: 'Zerya Bet眉l', surname: 'Baran', birthYear: 2017, birthCity: 34 },
         { name: 'name Test', surname: 'Test', birthYear: 2017, birthCity: 34 },
        ]}  

In the filter column 'birthCity' i come in with '34'.
The grid render the two records with 'birthCity: 34'.
I want to get the result containing two records.

Result:{[
{ name: 'Zerya Bet眉l', surname: 'Baran', birthYear: 2017, birthCity: 34 },
{ name: 'name Test', surname: 'Test', birthYear: 2017, birthCity: 34 },
]}

Check out https://material-table.com/#/docs/features/remote-data

Event though you might be not working with remote data, you can provide your own callback to the data property. You can then filter your local data manually and get direct access to the result.

I'm not sure if there is currently a more direct way.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.

Was this page helpful?
0 / 5 - 0 ratings