Hi,
thanks for your post, and sorry for the trouble.
Yes, that should be possible, but the Buttons will then have to be configured manually.
Let’s start with a test for the CSV button. Please add this to the “Custom Commands” text field on the table’s “Edit” screen:
"buttons": [ { "extend": "csv", "exportOptions': { "modifier": { "page": "current" } } } ]
Regards,
Tobias
Thank you for the prompt response Tobias,
Unfortunately that code snippet didn’t work, it seems to wipe out all the buttons and pagination. But it gave me some clues and I ended up with the following working code for all the buttons:
"buttons": [
{
extend: 'copy',
exportOptions: {
columns: ':visible',
rows: ':visible'
}
},
{
extend: 'print',
exportOptions: {
columns: ':visible',
rows: ':visible'
}
},
{
extend: 'csv',
exportOptions: {
columns: ':visible',
rows: ':visible'
}
},
{
extend: 'excel',
exportOptions: {
columns: ':visible',
rows: ':visible'
}
},
{
extend: 'pdf',
exportOptions: {
columns: ':visible',
rows: ':visible'
}
},
]
The only bit remaining is to figure out how to enable server side processing. This would enable us to fetch only a subset of rows at a time. Is that currently possible with TablePress?
-
This reply was modified 3 years, 10 months ago by
samthedev.
Hi,
ah, yes, I had a wrong quotation mark (single instead of double) in my example. It should have been
"buttons": [ { "extend": "csv", "exportOptions": { "modifier": { "page": "current" } } } ]
But your solution is indeed even better as mine likely only covers the pagination case, but not e.g. filtering.
Good to hear that you found this! Thanks for sharing it!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!
Already given 5 stars. Thank you once more for the assistance!
Hi,
thanks, I really appreciate it!
Best wishes,
Tobias
Hi,
just saw that I totally forgot about replying regarding server side processing: Sorry, that’s not currently possible with TablePress. I do however plan to add support for this in TablePress 2.0, likely as a premium feature.
Best wishes,
Tobias
That would be wonderful!
I presume the feature would include server & client side ajax-powered pagination for large tables.
Looking forward to it. Is there a waiting list that I can enroll for this?
Hi,
yes, the client would send AJAX requests to only retrieve the data that is necessary. One this is finished, I’ll release TablePress 2.0, for which you will see an update notification on your site, and where you’ll then also find more information about this. In addition, I’ll post more on tablepress.org and on TablePress’ Twitter account @tablepress, so watch those too.
Best wishes,
Tobias