exporting child table data
exporting child table data
Hi,
I have a datatable that displays master data and when a row is clicked, the relevant detail data is diplayed by adding new rows to the master data table example master table woulddisplay order information and when clicking on the an order row, a new row below it would display additional rows containing line item information.
I am doing this by storing the child data rows as hidden data in the main datatable column and showing it in new row when the row is clicked.
Will it be possible to export this child rows using the export pdf/excel functionality of the data table? The printscreen shows the data correctly, however , the pdf export functionality shows the child data (in the hidden column) which is not correctly formated. Ideally it should be below the main mater table row.
if there are any other approaches this functionality , kindly let me know.
Thanks, Julio
Answers
Hi @juliojrsouza ,
One way to go would be to use the callback
customizeData
- there's an example of here from this thread.customizeData
passes the data to you, before it goes into the export - in the case of that example it just tweaks the numbers to stop Excel from treating it in a certain way. For you, you could add your child rows into the dataset at the right place. I haven't tried that, but suspect it should do as you want.Cheers,
Colin