Ag-grid: Server side integration with redux

4

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 ?

Wykks picture Wykks  ·  11 Jul 2017

Most helpful comment

2

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.

nrgonzalez777 picture nrgonzalez777  ·  3 Aug 2017

All comments

0

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.

cliffsun91 picture cliffsun91  ·  25 Jul 2017
2

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.

nrgonzalez777 picture nrgonzalez777  ·  3 Aug 2017
-8

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.

makinggoodsoftware picture makinggoodsoftware  ·  19 Dec 2017