Hi,
sorry, I’m not aware of a solution to that. You might want to check on https://www.datatables.net/ where the original code for the Print button comes from.
Regards,
Tobias
Hey Tobias,
I already opened a new topic here https://datatables.net/forums/discussion/43201/print-unique-rows-based-on-a-column-and-disable-a-column-from-printing
I got an answer but I do not understand a lot! Actually, I do not know where into yours plugin code to search in order to put additional functionality.
Thanks
For example, in this example: http://yesmedia.eu/xenialive/table-press/
I would like to print only the rows where the value of the hidden column-2 is “1”.
Regarding with that page: https://datatables.net/reference/type/row-selector
My additional code will be something like this
// Find indexes of rows which have value one "1" in the second column
var indexes = table.rows().eq( 0 ).filter( function (rowIdx) {
return table.cell( rowIdx, 1 ).data() === '1' ? true : false;
} );
But where to put this snippet code?
Thanks
Hi,
adding this to TablePress or the Extension is not really possible. Your best solution would therefore probably be to add all DataTables functions manually. This means that TablePress is only used to deliver the HTML code for the table, and you then load and initialize the DataTables JS library and the JS code for the Buttons add-on manually, with custom code.
Regards,
Tobias