-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Update pageResize plugin. Add paging parameter and callback. #359
base: master
Are you sure you want to change the base?
Conversation
Could you give me a link to a page showing the issue and it being resolved? I don't quite get it I'm afraid. |
Sorry, I can't give a link because it's inside intranet. I'll try to justify the usefulness of this update in more detail. First of all, with this update it's possible to preserve current page number and not to reset it to the first one when the draw function is called by the pageResize plugin. Now we can choose which paging option the plugin will use by specifying the value of the new parameter pageResizeDrawPagingParameter which passed to the draw function call, i. e. it's the paging parameter of the draw function passed to it's call inside the plugin. As for the callback pageResizePreDrawCallback. It allows to override the value of the paging parameter per draw function call from the pageResize plugin based on external conditions. It also allows to cancel draw call (by returning false) based on external conditions and/or on the values coming to the callback parameters from pageResize: new page length and old page length. I used this callback to temporary halt the pageResize plugin based on the external condition. My case is the following.
|
… function call inside pageResize plugin. Add callback which called before draw and provides cancel ability and ability to override the draw paging parameter.
Update pageResize plugin. Add paging parameter to pass it to the draw function call inside pageResize plugin. Add callback which called before draw and provides cancel ability and ability to override the draw paging parameter.
This update became necessary when I started to save the state of the table and decided to reflect the state in URL parameters and load the state from the URL parameters. It was necessary that one user could send a link to another user with a clearly defined list of table rows, taking into account the search string, the number of rows on the page number (despite the screen resolution differences of both users), and the sorting. At the same time, I still needed pageResize, but I had to keep it from being included in the work initially to display the same rows collection as it was sent first or at least I needed to preserve page and not reset it to first page.