Open acbart opened 7 months ago
The only way currently is to generate the html text for the select explicitly and bind it to a container.
@BindValue(“somediv”)
Text:string=””;
Then
this.Text=”
Items.forEach(item=>this.text+=””
this.Text+”
From: Austin Cory Bart @.> Sent: Sunday, April 14, 2024 12:27 PM To: gsilber/WebEZ @.> Cc: Subscribed @.***> Subject: [gsilber/WebEZ] Creating Dynamic Dropdowns (Issue #18)
What's the "correct" way to create a dynamic dropdown in WebEZ? I know I cannot just bind an array to a select (although perhaps @clause https://github.com/clause 's new code will allow that). I had thought I would create a component that just has
I can't find any way to inject arbitrary HTML at runtime, so I can't even hack in something like this.insertHTML(${value}, "options"). Is there some other strategy I haven't thought of for making this work? Or should I be trying to build a BindOptionsToStrings decorator based on the example from before?
— Reply to this email directly, view it on GitHub https://github.com/gsilber/WebEZ/issues/18 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVF3IDYUBO7GBKWVSM6NK3Y5KU4HAVCNFSM6AAAAABGGHXKB2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2DEMRUGYYTCOA . You are receiving this because you are subscribed to this thread. https://github.com/notifications/beacon/AHVF3IFA2FYCLXJFOLTDGGTY5KU4HA5CNFSM6AAAAABGGHXKB2WGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHILJPV4Y.gif Message ID: @. @.> >
What's the "correct" way to create a dynamic dropdown in WebEZ? I know I cannot just bind an array to a select (although perhaps @clause 's new code will allow that). I had thought I would create a component that just has
<option>
inside, but that doesn't work because of all thediv
stuff surrounding any given component - it doesn't become a validselect
box.I can't find any way to inject arbitrary HTML at runtime, so I can't even hack in something like
this.insertHTML(
, "options")
. Is there some other strategy I haven't thought of for making this work? Or should I be trying to build aBindOptionsToStrings
decorator based on the example from before?