You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there an external library or something I am missing that allows taking a struct from a database representing a list of <options in an HTML template and setting the one selected in the case of a single select dropdown, or multiple selected and handling that in an html template. What do you usually do in your framework to support this.
For example, in a simple example, I may have a table called color that I have columns of ID and color_name, with 1-red, 2-blue, etc. I want to have a <select with the options from this lookup table but my actual data is lets say a table that has my favorite color and other preferences. I would want to on CREATE.. in the template allow them to choose from that color list and on UPDATE show what I selected before in the list and allow it to be changed. I might have MANY of these lookup boxes.
in WebApps, this is very common, and so I was wondering if this was baked in someplace and I missed it or if you have someway you usually do this.
The text was updated successfully, but these errors were encountered:
@jerrybroughton It is a fair question. I also once got stuck on this issue and couldn't find a direct solution. Cause I have to use range template function. But when you enter range function the scope changes so the code I write doesn't work. I have looked at different templating languages on Go. But it must be ways to leverage that in standard templating.
You should be able to get the multi-select to work like this. On the page load, the red and blue options will be selected. Is that what you're looking for?
Is there an external library or something I am missing that allows taking a struct from a database representing a list of <options in an HTML template and setting the one selected in the case of a single select dropdown, or multiple selected and handling that in an html template. What do you usually do in your framework to support this.
For example, in a simple example, I may have a table called color that I have columns of ID and color_name, with 1-red, 2-blue, etc. I want to have a <select with the options from this lookup table but my actual data is lets say a table that has my favorite color and other preferences. I would want to on CREATE.. in the template allow them to choose from that color list and on UPDATE show what I selected before in the list and allow it to be changed. I might have MANY of these lookup boxes.
in WebApps, this is very common, and so I was wondering if this was baked in someplace and I missed it or if you have someway you usually do this.
The text was updated successfully, but these errors were encountered: