Skip to content
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

Title with enums #28

Closed
WoodySlum opened this issue Jan 12, 2016 · 3 comments
Closed

Title with enums #28

WoodySlum opened this issue Jan 12, 2016 · 3 comments

Comments

@WoodySlum
Copy link

Hi,

Is it possible to set enums title :

gatewayMode: {
                    "type": "number",
                    "title": "Gateway mode [0 : Proxy, 1 : Redirect]",
                    "enum": [
                        0,1
                    ]
                }

I would like to do something like :

gatewayMode: {
                    "type": "number",
                    "title": "Gateway mode",
                    "enum": [
                        {"title":"Proxy, "value":0},
                        {"title":"Redirect, "value":1}
                    ]
                }
@ulion
Copy link
Owner

ulion commented Jan 12, 2016

sorry, did not get what you want. you can always set title to any string
you want.

2016-01-12 20:50 GMT+08:00 Sebastien M. notifications@github.com:

Hi,

Is it possible to set enums title :

gatewayMode: {
"type": "number",
"title": "Gateway mode [0 : Proxy, 1 : Redirect]",
"enum": [
0,1
]
}

I would like to do something like :

gatewayMode: {
"type": "number",
"title": "Gateway mode",
"enum": [
{"title":"Proxy, "value":0},
{"title":"Redirect, "value":1}
]
}


Reply to this email directly or view it on GitHub
#28.

Ulion

@WoodySlum
Copy link
Author

Ok I agree it was not really clear :)
I'm using enum to generate dropdown lists (select html elements).
With enum, I can't set a title for each enum values.

In my example above, in the first case the end user can see 0 or 1 in the select box.
In the second example - which does not work - I tried to set a title for each enum elements.

To be clear :

What I got :

<option value="0">0</option>
<option value="1">1</option>

What I want :

<option value="0">Proxy</option>
<option value="1">Redirect</option>

@ulion
Copy link
Owner

ulion commented Jan 12, 2016

that can be done by form element definition certainly. please check the
examples.

2016-01-12 22:06 GMT+08:00 Sebastien M. notifications@github.com:

Ok I agree it was not really clear :)
I'm using enum to generate dropdown lists (select html elements).
With enum, I can't set a title for each enum values.

In my example above, in the first case the end user can see 0 or 1 in the
select box.
In the second example - which does not work - I tried to set a title for
each enum elements.

To be clear :

What I got :
0
1

What I want :
Proxy
Redirect


Reply to this email directly or view it on GitHub
#28 (comment).

Ulion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants