react-redux-grid icon indicating copy to clipboard operation
react-redux-grid copied to clipboard

how to refresh with remote dataSource from another action

Open rednaxus opened this issue 6 years ago • 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?

rednaxus avatar Mar 02 '18 03:03 rednaxus

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

diego-inflightvr avatar Apr 25 '18 16:04 diego-inflightvr

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.

jiangenhe avatar Apr 26 '18 01:04 jiangenhe