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

Interactive Drop-down for specific columns #393

Open
coppertank opened this issue Sep 28, 2024 · 1 comment
Open

Interactive Drop-down for specific columns #393

coppertank opened this issue Sep 28, 2024 · 1 comment

Comments

@coppertank
Copy link

Online I found this tutorial that explains how to create an interactive filter with reactable. The result is the following:

Screenshot 2024-09-28 231139

I need to get a similar result, the difference is that I don't need to create a filter, but a drop-down menu to select a weight for which the corresponding column needs to be multiplied. An example is this:

Screenshot 2024-09-28 012544

In this example, only the columns with numeric values ​​have the drop-down menu, through which you can select a weight and multiply each value in the column by that weight, updating the table in real time.

Is there a way to achieve this in reactable?

@glin
Copy link
Owner

glin commented Oct 7, 2024

Custom metadata would be one way to do this if the multiplied value is purely for display, i.e. all filtering/sorting would still be done on the original raw value.

Here's an example of using custom metadata to multiply and reformat column values, for a currency conversion: https://glin.github.io/reactable/articles/examples.html#custom-meta-rendering

If you want the dropdown in the filter slot, you can reference the custom filter input examples but just use the inputs to run Reactable.setMeta() instead of Reactable.setFilter().

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