Is it possible to disable pagination dynamically on a footable, that has paging, so that all the table data can be printed to excel?
For example, if the table has paging, but then when they click export, it will disable paging and show all the data without paging, so that the data can be exported with excel.
This seems to get rid of paging, but only the data from the first page will remain.
$(".foo-table").footable({ paginate: false });
Current Code:
var ft = FooTable.init('.foo-table');
function populateContractorPayments(values, reload) {
//check filters
$.getJSON("/PaymentsApi/GetContractorPayments", { values: JSON.stringify(values) }, function (data) {
//console.log("Got Contractor Payments");
}).done(function (model) {
viewModel = ko.mapping.fromJS(model);
var jsModel = ko.toJS(viewModel);
ko.applyBindings(viewModel);
//Set Page Filters
var filters = [], def = 'All Users';
$.each(jsModel, function (i, val) {
$.each(val.Roles, function (i, val) {
if (!filters.includes(val)) {
filters.push(val);
}
})
});
setPageFilters(filters, def);
ft;
}
function printToExcelClick() {
$(".foo-table").footable({ paginate: false });
$(".foo-table").tableExport();
}