SelectAll Button - Select only rows filtered with SearchPanes or SearchBuilder
SelectAll Button - Select only rows filtered with SearchPanes or SearchBuilder
Hello all,
I encountered the following problem today:
When I use SearchPanes or SearchBuilder to filter my table, it works fine. But afterwards I want to select all filtered entries to export them.
But when I use the "selectAll" button, it ignores my filter and just selects all entries from the table.
Is there a better solution for this?
In my case, it is necessary that the individual entries, which was filtered before, are selected. But if there are several hundred entries, a manual selection would be too time-consuming.
Following post only solved the problem if you used the search function:
https://www.datatables.net/forums/discussion/comment/47085
But this should not be used. Only Searchpanes and SearchBuilder.
Thanks a lot!
Schwaluck
This question has an accepted answers - jump to answer
Answers
See this eexample for selecting the rows to export. If you want to export the remaining rows after searching use the
selector-modifier
of{search: "applied"}
. You don't need to select them, unless you want to for other reasons.Kevin
Hi kthorngren,
thank you for your quick response. Unfortunately, that doesn't solve my problem properly. Because yes, I sometimes want to export all entries at once, but sometimes only a handful of the filtered ones and if I understood the docs correctly, the setting (selected: null) would result in all entries always being selected for export after filtering, right?
So the SelectAll button would be perfect if it would only select the filtered entries in the table.
Do you have any idea how I can adjust the selectAll Button to achieve this?
Thanks and best regards
schwaluck
The
selectAll
docs state this:To export the filtered rows you would do something like this:
Kevin
Hey Kevin,
I found the solution that worked for me:
Thank you anyway!
Best regards
schwaluck