function editQsos() { const id_list = getSelectedIds(); if (id_list.length === 0) { BootstrapDialog.alert({ title: 'INFO', message: 'You need to select at least 1 row to use batch edit!', type: BootstrapDialog.TYPE_INFO, closable: false, draggable: false, callback: function (result) { } }); return; } $('#editButton').prop("disabled", true); $.ajax({ url: base_url + 'index.php/logbookadvanced/editDialog', type: 'post', success: function (html) { BootstrapDialog.show({ title: 'Batch edit for QSOs', size: BootstrapDialog.SIZE_WIDE, cssClass: 'options', nl2br: false, message: html, onshown: function(dialog) { prepareEditDialog(); $('#saveButton').prop("disabled", true); }, buttons: [{ label: lang_admin_save, cssClass: 'btn-primary btn-sm', id: 'saveButton', action: function (dialogItself) { var column = $("#editColumn").val(); if (column == 'date') { var value = $("#editDate").val(); if (value.length == 0) { return; } } saveBatchEditQsos(id_list); $('#editButton').prop("disabled", false); $('#closeButton').prop("disabled", true); dialogItself.close(); } }, { label: lang_admin_close, cssClass: 'btn-sm', id: 'closeButton', action: function (dialogItself) { $('#editButton').prop("disabled", false); dialogItself.close(); } }], onhide: function(dialogRef){ $('#editButton').prop("disabled", false); }, }); } }); } function prepareEditDialog() { $('#editDxcc').html($('#dxcc').html()); $('#editDxcc option[value=""]').remove(); $('#editIota').html($('#iota').html()); $('#editStationLocation').html($('#de').html()); $('#editStationLocation option[value="All"]').remove(); $('#editStationLocation option:first').prop('selected', true); propagationCopy(); /* Populate the Satellite Names in edit dropdown */ $.getJSON(site_url + "/satellite/satellite_data", function( data ) { // Build the options array var items = []; $.each( data, function( key, val ) { items.push( '' ); }); // Add to the datalist $('#editSatellite').append(items.join( "" )); var option = $('' ); }); // Add to the datalist $('#editDxccStateList').append(items.join( "" )); } } }); }