-
-
Notifications
You must be signed in to change notification settings - Fork 652
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
An option to display optgroups names instead of list of options in the title #29
Comments
WOW!!! |
Is it possible to disable this notation and use the original in your current release of multi-select? |
For anyone looking to have their selections appear as:
As opposed to:
You can change the following code (Line 560 to 570): html.push('[');
html.push(text);
if ($children.length > $selected.length) {
var list = [];
$selected.each(function () {
list.push($(this).parent().text());
});
html.push(': ' + list.join(', '));
}
html.push(']');
texts.push(html.join('')); To: // Modified to not include option groups in selected items text
var list = [];
$selected.each(function () {
list.push($(this).parent().text().trim());
});
html.push(list.join(', '));
texts.push(html.join('')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think that it also can be useful to have an option to display optgroup names instead of list of options in the title, when the whole groups were selected.
![2013-11-21 10_48_52-multiple select](https://camo.githubusercontent.com/bd07afaa6803a00cff8b32dbc813bdc65bf7c839ddcaeb59aff192b84ee81820/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f323839313739322f313538393735322f38626462653336382d353237392d313165332d383832612d3639616566336462646636382e706e67)
For example we can turn this:
into this
[Group1], [Group3]
instead of "Option1, Option2, Option3, Option7, Option..."
Optionally, it also can be displayed in the following way:
[Group1: Option1, Option2], [Group3: Option7]
The text was updated successfully, but these errors were encountered: