-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add <optgroup> support to selectInput()/selectizeInput() #520
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
Conversation
|
Okay, this PR should be complete now. For those who want to use |
…lar, even when `choices` is a list of lists (optgroup)
…oices note the nested level of optgroup can be greater than one here, however, the HTML4 spec only allows one level, i.e. optgroup must have select as its direct parent http://stackoverflow.com/q/1037732/559676
…tgroup nodes must be named
…; this function is only for shiny <= 0.9
…d radioButtons(), and use the new generator generateOptions() for them
…Buttons() work now session$sendInputMessage() does not send options as the choices data, but as a pre-generated raw HTML string; in shiny.js, we just receive this string, and .append() it to the input after the input is emptied
…generate it no matter what the child element is
e.g. we use <optgroup> for A even if A only has one element: list(A = 'a', B = c('b1', 'b2'))
|
I have made two examples for this PR.
I do not have anything else to add to this PR except a news item. These two examples will be added to shiny dev center later. |
|
For the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part looks too tricky to me - I'd really prefer a more straightforward way of accomplishing the same goal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The more straightforward way is probably to copy and paste, which is less desirable.
|
I have tested the |
|
OK, that sounds like a good reason to generate the HTML on the server side. |
A test case: