copy only selected rows to clipboard when no rows are selected and there are hidden rows

copy only selected rows to clipboard when no rows are selected and there are hidden rows

rogertranchezrogertranchez Posts: 1Questions: 0Answers: 0
edited January 2014 in TableTools
Hello,

I'm using the function [code]$.fn.dataTableExt.afnFiltering.push()[/code] to filter the visible rows on the datatable, so not all the real rows in the datatable are shown (I'm hiding some of them with a field-based criteria).
My problem is that when I don't select any row (with tabletools), the "copy" to clipboard is copying all the rows, including those that are not visible.

Note that I'm already using the [code]"bSelectedOnly": true[/code] option in [code]{"sExtends": "copy"...}[/code] section, but as long as I don't have any rows selected, tabletools gets all the rows.

If I select all the visible rows, it works correctly, but as long as the default behaviour for the copy if no rows are selected is to copy ALL the rows, the hidden ones are also included.

I've tried to use the "sExtends": "copy" ... using the [code]"fnClick": function (nButton, oConfig, oFlash) ...[/code] to be able to select the rows before the copy to clipboard action, and then using the "fnComplete" function to unselect all after the copy, but the problem is that if I'm overriding the copy action with fnClick(), the COPY action is NOT triggered, and I don't know how to call it manually.

Is there a way to do it ? I don't want the users to get the hidden rows when copying to clipboard if no rows are selected...

Thanks in advance,

Roger
This discussion has been closed.