I'm using tablesorter as the view. I have a table of records and there are 3 scenarios of export:
I'm a bit confusing of how can I implement these scenarios... Here are my assumptions and doubts:
$('#table tr')
. Yeah, it will really export all$('#table tr')
and for each item check if it the checkbox is enabled$('#table tr:visible')
, but what if I have 12 filtered records, but only 10 records are on the page and another 2 are on another page?Are there some best-practices of how to derermine which records should be exported (into csv/xls) for these 3 cases?
The output widget has a output_savedRows
option which has the following settings:
"filtered"
which outputs rows that match the filter query. It does this by using the following selector:
$('tr').not('.filtered')
a class added by the filter_filteredRow
option
"visible"
which only outputs visible rows. Rows hidden by the pager, filter or set to display: none
will not be included in the output. The visible selector is used in this case:
$('tr:visible')
"all"
will output all rows. This includes hidden & filtered rows.
$('tr')
I plan to add a new setting "selected"
in v2.22.2, which will use a new option output_selected
that includes a row class name that the output widget uses to include in the output.
$('tr.selected')