bencripps/react-redux-grid

how to refresh with remote dataSource from another action

Opened this issue · 2 comments

Suppose I have another component that does something that makes me want to re-load the remote dataSource. I should be able to call an action to reload, how do I do this?

Hi @rednaxus,
It's probably too late to answer your question, but just in case... This is how I did it:

import { Actions } from 'react-redux-grid'

store.dispatch(
Actions.GridActions.getAsyncData({
showTreeRootNode: false,
stateKey,
dataSource: treeDataSource,
type: gridType
}))

Cheers,
Diego

In my case, I just gave a new key value to Grid component, which will force Grid to be remounted and reload all data. It may not be best way in terms of rendering performance but easy to be made.