Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server side integration with redux #1751

Closed
Wykks opened this issue Jul 11, 2017 · 7 comments
Closed

Server side integration with redux #1751

Wykks opened this issue Jul 11, 2017 · 7 comments

Comments

@Wykks
Copy link
Contributor

Wykks commented Jul 11, 2017

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[X] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/ceolter/ag-grid/blob/master/CONTRIBUTING.md#question

Current behavior
The example with redux is great, but only with "In Memory" row model.

What is the motivation / use case for changing the behavior?
Using infinite scroll, we could use getRows and dispatch there, but successCallback and failCallback doesn't make sense in this case.

The "In Memory" row model is almost good enough if we want to load data on the fly, but listening to grid events to dispatch redux action seems a bit too "hacky".

Maybe introduce a new row model for Redux ?

@cliffsun91
Copy link

cliffsun91 commented Jul 25, 2017

We're using Redux in our application with ag-grid. We use the infinite scroll model (though in pagination mode) and we currently don't use any dispatch actions to get data. We just directly fetch in the getRows function and use the successCallback and failCallback in the returned promise from fetch. This works well for us, with the only caveat being that we can't directly control when the fetch request occurs (Ag-grid calls getRows). The other thing is that the data itself is not stored in the Redux state but that works well for us as we're currently only read data and not modifying it.

I don't think it's "hacky' to dispatch redux actions on grid events, if you're using a react-redux and the connect method to mapDispatchToProps, then your dispatch actions (to fetch data) are just normal callback methods from the React component's (the component wrapping AgGridReact) point of view.

@nrgonzalez777
Copy link

We are currently writing a Redux-based Angular application in which we want to use the infinite scroll model of ag-grid (we currently use ag-grid simply in the deltaRowDataMode, but will need infinite scroll in a few cases). As @cliffsun91 said, I think the only practical way to do that right now is to not store your rows in Redux state, but rather have your ag-grid data source directly query the api. However, this would be a break from our usual architecture pattern. It would be super nice if ag-grid had a way to store the infinite scroll state within a reducer so we could store the component's state in a manner that is much more accessible as well as consistent with Redux architecture patterns.

@makinggoodsoftware
Copy link
Contributor

Hi,

Thank you for raising this issue for us, at this moment we are reviewing how we process Feature Requests/questions that come through from GitHub.

As I am sure you are aware, we offer two products:

ag-Grid - this is entirely free to use in line with our MIT license
ag-Grid Enterprise - our commercial version which funds the development of both versions.

We currently have a very full pipeline of work which can be viewed here: https://www.ag-grid.com/ag-grid-pipeline/

This will be our priority for the coming months and as a result, we don’t have capacity to take feature requests/questions from GitHub, but you might find that yours has already been raised in our pipeline.

We will do a periodic review of GitHub issues for any bugs raised and these can also be tracked on our pipeline page.

Thanks for your understanding.
ag-Grid Team.

@omriye
Copy link

omriye commented Dec 15, 2021

Hello everybody,
3 years after your interesting discussion, I'm dealing with the same issue (implementing ag-grid in a redux-based application) and try my luck:
Is there such a row model by now? @Wykks @cliffsun91 @makinggoodsoftware
Unfortunately couldn't find anything supporting it on the web...

@MalkaGloiberman
Copy link

@omriye did you find any solution I am stuck with the same issue

@omriye
Copy link

omriye commented Jul 19, 2022

@MalkaGloiberman unfortunately not, it is simple not supported. The compromise is to leave redux out of the pagination and to perform direct api calls with "async ... await", in order to retrieve the next data chunk.
Good luck!

@minaairsupport
Copy link

after about 5 years from the discussion stared I dont think you fixed the issue

could you just make it like this in server side render

rowData={data}
pageSize={pageSize}
  onPageSizeChange={(newPageSize) => setPageSize(newPageSize)}
  rowsPerPageOptions={[5, 10, 20]}
  pagination

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants