dropdowns

This commit is contained in:
2025-08-30 10:19:53 +00:00
parent 7a3f58a551
commit 66e000879d
3 changed files with 23 additions and 19 deletions

View File

@@ -59,28 +59,29 @@ var EcmDropdownEditor_save = function(dom, container) {
return false;
}
var doms = EcmDropdownEditor_parseArrays(dom);
var params = new Array;
var params = [];
params[0] = dom; //name of list
params[1] = doms;//list of values
// AJAX call
jQuery.ajax({
type : 'POST',
url : 'index.php?entryPoint=HandleEcmAjax',
type : "POST",
url : "index.php?entryPoint=HandleEcmAjax",
data : {
ecmclass : 'EcmDropdownEditor',
job : 'saveDom',
ecmclass : "EcmDropdownEditor",
job : "saveDom",
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
},
dataType : 'json',
dataType : "json",
async : false,
success : function(response) {
var div = $('[name='+container+']');
div.hide();
EcmDropdownEditor_refreshField(container);
return;
success : function() {
setTimeout(function() {
EcmDropdownEditor_refreshField(container);
var div = $("[name="+container+"]");
div.hide();
}, 3000);
},
error : function(xhr, ajaxOptions, thrownError) {
console.log(thrownError);
window.console.log(thrownError);
}
});
}
@@ -94,16 +95,17 @@ var EcmDropdownEditor_refreshField = function(container) {
params[1] = container;//list of values
// AJAX call
jQuery.ajax({
type : 'POST',
url : 'index.php?entryPoint=HandleEcmAjax',
type : "POST",
url : "index.php?entryPoint=HandleEcmAjax",
data : {
ecmclass : 'EcmDropdownEditor',
job : 'refreshField',
ecmclass : "EcmDropdownEditor",
job : "refreshField",
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
},
dataType : 'json',
dataType : "json",
async : false,
success : function(response) {
console.log('EditedDropdown', response);
var tmp = container.split("___");
$('form[name=EditView]').find('select[name='+tmp[0]+']').html(response[0]);
return;