Interactive Drop-down for specific columns
Online I found this tutorial that explains how to create an interactive filter with reactable. The result is the following:
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:
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?
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().