I am clicking a button to copy to the clipboard, a return of rows depending if a string ('star') is present. However, when the number of rows returned are 0, the popup window says "Copied one row to clipboard." And when I try to paste, it pastes the previously saved clipboard, which can cause confusion. What I would want is to have the clipboard erased if no rows are returned.
Is there a condition I can add so that the clipboard is erased if there are no rows returned? If not, are there any alternative practical solutions?
{
extend: 'copyHtml5',
text: 'Copy Star',
header: false,
title: null,
className: 'copy-star',
newline: ', ',
exportOptions: {
rows: function(idx, data, node) {
return (!data[8].toLowerCase().includes('star')) ? true : false;
},
columns: [0]
}
},