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

Paging over local data not working #199

Open
laurenga opened this issue Feb 2, 2018 · 5 comments
Open

Paging over local data not working #199

laurenga opened this issue Feb 2, 2018 · 5 comments
Labels

Comments

@laurenga
Copy link

laurenga commented Feb 2, 2018

I built the demo code locally, changed the 'pagingType' of the PAGER to 'local' and set a 'pageSize' of 5. When I ran the modified demo the 'local' pager doesn't work. The grid only shows the first page of data.

@bencripps
Copy link
Owner

I think if you take a look at the simple example, you should find what you need. This uses locally paged data.

@laurenga
Copy link
Author

laurenga commented Feb 5, 2018

I tried out the simple example and I've seen the documentation that notes the pagination plugin should default to enabled with a pagingType of 'local', however, this appears to be having issue.

I find that if the PAGER plugin is not specified as enabled then no paging toolbar shows up.

If I try PAGER: {enabled: true, pagingType: 'local'} then I do see the paging toolbar. When clicking next I see the PAGE_LOCAL action fired but the data in the grid doesn't change

@GOVYANSONG
Copy link

GOVYANSONG commented Feb 23, 2018

@laurenga I am experiencing the same issue. The PAGE_LOCAL action was dispatched properly but page did not seem to move as expected. Below is my code:

//
export const BUTTON_TYPES = {
NEXT: 'next',
BACK: 'back'
};
//
const action = {
index: this.state.activePage * 1 + 1,
type: ReactReduxGrid.ActionTypes.PAGE_LOCAL,
BUTTON_TYPES: btnTypes
};
//
this.context.store.dispatch
(
Actions.PagerActions.setPage(action)
);
@bencripps would it be possible to provide a practical example on local pagination?

@GOVYANSONG
Copy link

@bencripps I did more digging in the documentation and source code. My question now is: in local data mode, is stateKey required when dispatch action PAGE_LOCAL? I guess not because no parameter is reserved for it. In this light, how is local grid identified then? A bit confused

@Rohmin
Copy link

Rohmin commented Jul 23, 2018

export const setPage = ({ index, type, BUTTON_TYPES }) => {
//in this action it does not take in the state key, but from the button it is send
store.dispatch(
setPage({ index: pageIndex, type, BUTTON_TYPES, stateKey })
);

is this the reason that the next button on local data does not work?
@bencripps It also doesnt work in the simple example, fyi.

I tried to solve this myself however I didnt understand what this reducer does, its different from how I normally make reducers in redux

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

No branches or pull requests

4 participants