-
Notifications
You must be signed in to change notification settings - Fork 22
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
Refreshing with F5 issue #48
Comments
Hi, Can you post a sample of your code or even better create a github repository with a page/route to replicate the issue? |
Great! will do it asap! |
Hi @Kurounin ! Just pushed my repo to replicate the issue https://github.com/mgscreativa/meteor-kurounin-pagination-refresh-issue You login as admin with "admin@admin.com" and password as "password" (without the quotes). After that, go to the "Activities" top menu item and see the list, if you press F5, you will get an endless loading animation!. If you click any item in the "Creator" column you will filter activities by user, and if you press F5, endless loading again... Another question: I'm implementing the filter by creator (the creator column) by modifying the filters of the pagination object in the createContainer HOC of imports/ui/components/DataGrid/DataGrid.js is that ok or should be implemented elsewhere? Thanks a lot! |
I spent some time trying to fix this, but the error seems to stem from somewhere else. export default createContainer((props) => {
let filters = {};
if (props.match.params._id) {
filters = {
createdBy: props.match.params._id,
};
}
console.log(filters);
props.pagination.filters(filters);
return {
ready: props.pagination.ready(),
items: props.pagination.getPage(),
}
}, DataGrid); |
Thanks @Kurounin ! I moved the filters setup to the Activities page component like this
And now my DataCrid createContainer HOC code looks like this
|
Regarding the F5 issue will try to remove the datagrid component to see what happens... |
Hi @Kurounin! Please check out my latest push to https://github.com/mgscreativa/meteor-kurounin-pagination-refresh-issue Test the link Activities No DataGrid It just prints some data using your react example but no luck, if I press F5 it doesn't get ready! |
@mgscreativa Take a look at the PR on your repository. |
Great! It does work now! By the way, reviewing my first pagination example here https://github.com/mgscreativa/kurounin-pagination-react-example there's no issue with f5 reloading. The difference between my actual project and the first example repo is that I switched boilerplates, the first one uses a modified version of Meteor Chef Base, and the second uses Meteor Chef PUP, the main difference is that it uses createContainer from react-meteor-data and in the App component it creates a container to track some vars. On the other hand, the first repo uses a custom container HOC in /modules/container created with compose from react-komposer and a custom meteor/tracker in /modules/get-tracker-loader. I think the issue is that the new boilerplate messes up with the main App component ant that maybe renders Meteor confused about other trackers... |
Well, it almost did it... Another issue I found here is that if I refresh with F5 and lets say I'm at page 3, the page counter gets reset to page 1... Clicking on page 3:
After refresh with F5:
Take a look at the skip it got reset after F5... |
The page gets reset because that information is not kept anywhere (url or local storage). To keep the page after refresh you could watch for changes to the |
Thanks @Kurounin! After a revision of the code, It seems harder than I thought to implement your suggestion. In the first place, I can certainly create a new route lets say '/reactive-datatable/page/:page' and I was able to get that param and modify the DataTablesList component through componentWillReceiveProps but I can't set the BootstrapPaginator page to highlight! I saw in the BootstrapPaginator source that will receive a page prop but it seems unimplemented yet. For the rest, I think it's matter of using componentWillMount and componentWillReceiveProps combined with pagination.currentPage and setState. Thanks a lot for the advise, if you can review the BootstrapPaginator to accept that page prop will be great. PS1: At this time, the F5 hack did the trick, now I'm insisting on this for pure hobby on my own |
BootstrapPaginator doesn't have a page param, because it reads the current page directly from the pagination instance, so once you set the initial page to the pagination there's no need to do anything else for the paginator. |
@mgscreativa I created a new PR which implements the page url query param. |
Hi! If I refresh the page with F5, I don't get any results.
Accessing through defined route, gets the desired page results, but if I press F5 in that route, I don't get any results. I'm currently using Meteor 1.5.1, React 15.5.4 and createContainer HOC.
It seems that on my createContainer props.pagination.ready() never gets true...
Client log by following a route
Server log by following a route
Client log after pressing F5
Server log after pressing F5
The text was updated successfully, but these errors were encountered: