export pdf and csv #4402
Replies: 3 comments 6 replies
-
You can easily hook up all of the getRowModel methods to a data export library. You can kind of get an idea for how to do this in an example of this library that is built on top of TanStack Table. Pretty much just connect whichever row model you want to a custom export library like https://www.material-react-table.com/docs/examples/data-export |
Beta Was this translation helpful? Give feedback.
-
when a client side pagination implemented through react table, I solved like that, export function loopReactTablePaginationData(tableInstance: any) {
try {
const stringify = JSON.stringify(tableInstance);
const clone = JSON.parse(stringify);
const rows: any = [];
for (let i = 0; i < clone.pageCount; i++) {
clone.page.map((item: any) => {
rows.push(item.original);
});
if (clone.canNextPage) {
clone.nextPage();
}
}
return rows;
} catch (err) {
console.log(err);
return [];
}
} but the recommended to way to export data just do it on server side |
Beta Was this translation helpful? Give feedback.
-
Thank you very much. Thank you for taking the time to guide me. Your
advice was very helpful for me.
…On Mon, Sep 26, 2022 at 3:20 PM Naveen 1337 ***@***.***> wrote:
when a client side pagination implemented through react table, I solved
like that,
export function loopReactTablePaginationData(tableInstance: any) {
try {
const stringify = JSON.stringify(tableInstance);
const clone = JSON.parse(stringify);
const rows: any = [];
for (let i = 0; i < clone.pageCount; i++) {
clone.page.map((item: any) => {
console.log(item);
rows.push(item.original);
});
if (clone.canNextPage) {
clone.nextPage();
}
}
return rows;
} catch (err) {
console.log(err);
return [];
}}
but the recommended to way to export data just do it on server side
—
Reply to this email directly, view it on GitHub
<#4402 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF4A6SO3AN3WQDN34KYODZ3WAGEYBANCNFSM6AAAAAAQUQDG2M>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
---------------------------------------------------------------
Best Regards.
Ashkan Kiani
Web Developer and Web Designer
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It is a good library, but it needs to add data output to the system.
How to get output from data. Settings for raw or modified data output.
For example, a data is shown with true, while we mean "paid". And we want the output to be shown like this.
Beta Was this translation helpful? Give feedback.
All reactions