How to refresh webpage when click next page in pagination?

How to refresh webpage when click next page in pagination?

BladeOnDataTablesBladeOnDataTables Posts: 1Questions: 1Answers: 0

I have just set up data tables on my website.

I want to be able to reload the webpage when i click the next page on pagination.

i have a javascript converter which is converting data in mysql and displaying it into the tables.

On the main page it seems to work fine, converts everything and when i disable pagination it converts everything but when i change the page it does not seem to display anything in the column to which my javascript function is suppose to be converting. i think the converter is not converting in time before the page loads.

is there anyway to force the pagination to reload the data before displaying it?

Answers

  • kthorngrenkthorngren Posts: 16,098Questions: 25Answers: 3,811

    The answer depends how you are loading the table data. Maybe you can use columns.render instead of the Javascript converter. See this example.

    Please provide more details of what you are doing. A link to your page or a running test case is the best way for us to understand the process.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • walemarkwalemark Posts: 1Questions: 0Answers: 0

    The reload() function takes an optional parameter that can be set to true to force a reload from the server rather than the cache. The parameter defaults to false, so by default the page may reload from the browser's cache. The true parameter forces the page to release it's cache.

    The window.location.reload() will reload from the server and will load all your data, scripts, images, etc. again. So if you just want to refresh the HTML, the window.location = document.URL will return much quicker and with less traffic. But it will not reload the page if there is a hash (#) in the URL.

Sign In or Register to comment.