How to toggle Report Pagination with visualize.js?

0
I want to toggle the Report Pagination in an interactive Report with Visualize.js. I have a checkbox and if this checkbox is checked, the Report should be rendered paginated. If the checkbox is unchecked, the Report should be rendered without pagination. Based on the Visualize.js Live-Sample for Pagination Events I came up with the following Idea: HTML-Snippet: Pagination Javascript-Snippet: $("#reportPagination").on("change", function() { var checkState = $(this); if(checkState.is(":checked")) reportPagination = false; else reportPagination = true; console.log("Re-Running Report with ignorePagination: " + reportPagination); report .pages(currentPage) .run({ ignorePagination: reportPagination }) .done(checkPagesConditions) .fail(function(err) { alert(err); }); }); Full Example: JSFiddle Report Pagination It did not work, the Report stays in intial pagination state (in my example it remains paginated). How can I get this to work? Greetings, Andreas
andreas.kuegler's picture
Joined: Aug 5 2019 - 3:39am
Last seen: 1 week 6 days ago

Thanks a lot @narcism, that was exactly what I'm looking for.

andreas.kuegler - 1 week 6 days ago

1 Answer:

0

In this case, the ignorePagination property is read-only, so once set, it cannot be changed unless you completely rerun the report. I've altered your fiddle here: jsfiddle.

In essence, I destroy the previous instance and then reset the report reference to the new one with the ignorePagination according to the checkbox.

narcism's picture
1149
Joined: Nov 22 2010 - 12:39am
Last seen: 4 hours 37 min ago
Feedback
randomness