-
Notifications
You must be signed in to change notification settings - Fork 168
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
Select option with value/title #85
Comments
Thanks for your kind words @minhdqtt! Can you give me an example of your schema? Where do you get the title (option visible name) from? |
Thanks for your reply. Imaging we have system that allow customer can select a web template, and each web template can modify some parameters. So, we have select tag:
When customer click on select (that change the template), we load the json schema from server. Because each template has difference option, for example, template 1 allow user change title, and type of menu (vertical or horizontal) and template 2 allow user to change title, and skin (light or dark), we use the code:
The return schema form server has something like:
so, the form can render the like:
Of cause, if user select template 2, the form like:
How can I archive this? |
Hi, this is easy with a decorator that in case of rendering a select (checking tagName), checks if the schema contains a "display" property, and in that case overrides the options inner text |
Thanks for your support. I put my code here to hope that it's helpful for someone:
|
It seems that the method to add descriptors to enumerated values in json-schema is via "oneOf" - as described in this issue: |
For a drop down
where Programs is an array
So the list of items in the drop down are names of the programs. Is there a way I can store ID instead of name, when the user selects the name from the dropdown? |
First of all, thanks for your awesome library, it helps me a lot...
I wonder if the library can render the select tag like:
for the enum, and I read the post #42, I found that we can use the script to decorate the returned object. But my situation is I load the scheme on the fly, and have no way to put the right decoration script.
I look into your source code: line 193-195:
then the value and the title are the same.
Is there any support for value/title select in near future?
The text was updated successfully, but these errors were encountered: