destroying then re-applying chosen for some reason auto-selects all options. Fix the problem by fixing the table width with css so that the underlying select is already 100%.

pull/4202/head
Isaac Connor 2024-11-06 12:21:57 -05:00
parent 6f8f47831f
commit ade3a01902
1 changed files with 3 additions and 5 deletions

View File

@ -4,8 +4,7 @@ function newGroup() {
.done(function(data) {
insertModalHtml('groupdModal', data.html);
$j('#groupModal').modal('show');
$j('.chosen').chosen("destroy");
$j('.chosen').chosen();
$j('#newGroupMonitorIds').chosen({width: "100%"});
})
.fail(logAjaxFail);
}
@ -17,7 +16,7 @@ function setGroup( element ) {
}
function editGroup( element ) {
var gid = element.getAttribute('data-group-id');
const gid = element.getAttribute('data-group-id');
if ( !gid ) {
console.log('No group id found in editGroup');
} else {
@ -25,8 +24,7 @@ function editGroup( element ) {
.done(function(data) {
insertModalHtml('groupModal', data.html);
$j('#groupModal').modal('show');
$j('.chosen').chosen("destroy");
$j('.chosen').chosen();
$j('#newGroupMonitorIds').chosen({width: "100%"});
})
.fail(logAjaxFail);
}