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
This is not a Pull request, but just an optional suggestion.
Depending on the number of options, we may use different types of List field. For example, if the number of options is less than 10 or so, use a checkbox, if more, use a drop-down list.
If the List field is a drop-down list with multiple options, I believe select2 is more convenient. So I tried to modify the local source code as following.
diff --git a/assets/javascripts/searchable_selectbox.js b/assets/javascripts/searchable_selectbox.js
index dedb790..50324b7 100644
--- a/assets/javascripts/searchable_selectbox.js+++ b/assets/javascripts/searchable_selectbox.js@@ -70,7 +70,7 @@ function replaceSelect2() {
if ($('body').hasClass('controller-workflows')) {
return;
} else {
- var selectInTabular = $('.tabular .splitcontent select:not([multiple]):not([data-remote]):not(.select2-hidden-accessible)');+ var selectInTabular = $('.tabular .splitcontent select:not([check_box_group]):not([data-remote]):not(.select2-hidden-accessible)');
if (selectInTabular.length) {
selectInTabular.select2({
width: 'style'
@@ -79,7 +79,7 @@ function replaceSelect2() {
});
}
- var other = $('select:not([multiple]):not([data-remote]):not(.select2-hidden-accessible)');+ var other = $('select:not([check_box_group]):not([data-remote]):not(.select2-hidden-accessible)');
if (other.length) {
other.select2().on('select2:select', function() {
retriggerChangeIfNativeEventExists($(this));
The text was updated successfully, but these errors were encountered:
ananas3
changed the title
Multiple values of with select2
Multiple values of drop-down lis with select2
May 4, 2023
ananas3
changed the title
Multiple values of drop-down lis with select2
Multiple values of drop-down list with select2
May 4, 2023
This is not a Pull request, but just an optional suggestion.
Depending on the number of options, we may use different types of List field. For example, if the number of options is less than 10 or so, use a checkbox, if more, use a drop-down list.
If the List field is a drop-down list with multiple options, I believe select2 is more convenient. So I tried to modify the local source code as following.
The text was updated successfully, but these errors were encountered: