Redux with Remote Data
See original GitHub issuehttps://github.com/mbrn/material-table/issues/630 Hi! Kinda same problem as above.
<MaterialTable
title="Editable Example"
columns={state.columns}
data={query => {
return new Promise((resolve, reject) => {
queryHandle(query.page, query.pageSize).then(result => {
resolve({
data: accountsPage,
page: page,
totalCount: total
})
})
})
}}
/>
This is my table. Function queryHandle
dispatches and action that puts accounts
into redux.
async accountsParams => {
try {
const accounts = await accountApi.get("list", {
...accountsParams
})
dispatch(getAccountsPageSuccess(accounts, accountsParams))
} catch (error) {
dispatch(addError(error))
}
But
resolve({
data: accountsPage,
page: page,
totalCount: total
})
here we always got “old version” of redux.
In the other case
<MaterialTable
title="Editable Example"
columns={state.columns}
data={accountsPage}
components={{
Pagination: () => (
<TablePagination
rowsPerPageOptions={[5, 10, 25]}
count={total}
rowsPerPage={pageSize}
page={page}
onChangePage={handleChangeListPage}
onChangeRowsPerPage={handleChangeRowsPerPage}
ActionsComponent={TablePaginationActions}
/>
)
}}
/>
in redux I have array of 10 entities (for example), but MT shows only 5 of them. Hope you will help me, thank you ^_^
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Handle RESTful Requests Data in React/Redux Apps - Medium
The idea is to handle modeling, fetching, and displaying RESTful requests data (Remote data) in React/Redux apps.
Read more >Redux Essentials, Part 4: Using Redux Data
The official Redux Essentials tutorial: learn how to work with complex Redux state in React components.
Read more >Redux with Remote Data #630 - mbrn/material-table - GitHub
I'm pulling data into the table using redux. It works seamlessly when I send the data directly without paging, but it does not...
Read more >Data Management with Redux - Fullstack React
Today, we are going to get back to code and on to adding Redux in our app. The app we're building with it...
Read more >Is there a way to sync local redux store with remote data?
I am looking to create an application with local redux store. But I want the store to sync frequently with a remote store...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Same issue while trying to update the
pageSize
dynamically through ReduxAfter investigation I realized that in my
<MTableBody>
inprops.renderData
I still get only 5 elements, andprops.pageSize
is still 5