jsfexporter
jsfexporter copied to clipboard
Support p:rowExpansion in p:dataTable
This is complicated.
Row expansions could just be made as additional rows in the export, but this could result in some useless exports. Suppose the export type is CSV and we have a dataTable with a rowExpansion that has another dataTable inside it: the resulting CSV will be completely useless since it will have headers in the data, probably a varying number of columns, and varying meanings of data within the same column. The best solution is probably to add a configuration option that allows the user to decide if they want the rowExpansion organized into additional columns or not. If yes, then instead of having DataTableExportSource produce rows like this:
header1, header2, header3 row1_cell1, row1_cell2, row1_cell3 row_expansion_header1, row_expansion_header2 row_expansion_row1_cell1, row_expansion_row1_cell2
we would instead produce rows like this: header1, header2, header3, row_expansion_header1, row_expansion_header2 row1_cell1, row1_cell2, row1_cell3, , , , , row_expansion_row1_cell1, row_expansion_row1_cell2
We should also provide an option to disable exporting the row expansion entirely.