Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add a custom download format to the download dropdown menu? #536

Open
hepcat72 opened this issue Oct 27, 2024 · 1 comment
Open

Comments

@hepcat72
Copy link

This isn't a bug or a feature request - this is a help request. I hope this is the right place for this. I figured that the response would be a new example, so I submitted this here for this reason.

There's a good bit of context to this question, but I will try and just get straight to the meat of it.

I would like to add a custom download "format" added to the builtin download drop-down menu and I'm not quite sure how best to do it.

The displayed table has a file column where it only displays the file name. I would like one of the download formats to be a zip-archive of just the files in that one column.

I have the backend all worked out. I can generate and stream the zip archive, no problem. I just need a "button" in the download's dropdown to submit a form that triggers the download.

I could create my own separate button that is independent of bootstrap table, but it would be slicker if I could add it right into the existing download options.

So now, some context...

So far, I've been implementing my own buttons alongside the bootstrap-table button toolbar. As you can see here, I have 3 custom buttons (reset, stats, and my own download button implementation) and a bootstrap-table toolbar that only contains the column selector:

image

For awhile now, the download button was not a drop-down and at the moment, I've been trying to implement a drop-down and realized that I would either need to dig into the innards of bootstrap-table or add another bootstrap library to make it work, so I decided instead that it would be better if I could finally sit down and learn how to fully utilize bootstrap-table's toolbar to implement all of these custom buttons, but for right now, I just want to add the download button.

The download functionality I've been doing until now is also custom. It is also a form submission, so if I utilize bootstrap-table's button bar, I would only want 2 items in the dropdown: my tsv format and my new zip archive of one of the columns' files.

@smillove
Copy link
Contributor

smillove commented Oct 27, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants