invent
invent copied to clipboard
Dynamic SELECT / MULTICHOICE options
It would be useful to be able to dynamically create a selector field e.g. using a list stored in the data_store, something like:
Card(
"my_selector_card",
form=Inputs.SELECT,
options={my_list_in_data_store},
...
)
or otherwise dynamically generate a list:
Card(
"my_selector_card",
form=Inputs.SELECT,
options=my_function(my_vars, ...)
...
)
hey @sudofrank sudofrank, I think this is a wonderful idea and would also like it for sliders. this is in the context of a gambling game
Card("betting", text="how much do you want to bet", form=Inputs.SLIDER,options=(0, int({money}), 5), buttons=[{"label":"bet", "target":bet},{"label":"all in","target":allIn}]),
Closing this since sliders (along with all the various ways you can configure them), are a part of HTML (see this, and since we're re-writing PyperCard on top of PyScript... "it should just work" :tm: 😉