-
Hello, I am studying the package with great interest and pleasure, but I have some questions that I still cannot get an answer from the documentation. In the example of the export function, all columns from getSelected get into the file, but I did not find a method that would transfer only the selected columns. There is an array in selectedColumns, but it is passing slugs. Is there any method to pass only selected columns? Thanks for the future answer! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I'm assuming you've built a custom export class, in which case you can pass that array into the constructor. |
Beta Was this translation helpful? Give feedback.
-
Yes, you are absolutely correct, but I apparently formulated my question incorrectly. I could not get the names of the selected columns as in the database to pass them on, but only slugs. But it's worth reading the documentation for more details. In any case, thanks! |
Beta Was this translation helpful? Give feedback.
To reverse a slug, you'll need the Str helper included, but this should work:
If not, I'll take a closer look later this week.
Otherwise, in the interim, just have an array mapping the slug to proper column name in your export class, and pluck out the proper column names for your select.