Commit 90fff872 authored by enured's avatar enured
Browse files

S13797 dynamic update works with single and multiple(itemList) checkboxes now.

parent e0ce90f3
Pipeline #6991 passed with stage
in 1 minute and 55 seconds
......@@ -1240,15 +1240,20 @@ var QfqNS = QfqNS || {};
}
try {
var element = $('[name="' + QfqNS.escapeJqueryIdSelector(formElementName) + '"]:not([type="hidden"])');
// unable to find formgroup throws an error and the checkboxes cant be set to checked. This is a quick workaround.
if(element.length > 1 && element.length !== countElementArray && $(element).attr('type').toLowerCase() ==='checkbox'){
element = element[countElementArray];
if (configurationItem.value !== undefined) {
$(element).prop('checked',configurationItem.value);
// checkboxes without being in form groups aren't triggered over dynamic update, we need to handle them separately.
// for checkboxes with itemList (multiple) we need the countElementArray to trigger the right box
if($(element).attr('type') !== undefined){
if($(element).attr('type').toLowerCase() ==='checkbox'){
if(element.length > 1 && element.length !== countElementArray){
element = element[countElementArray];
countElementArray++;
}
if (configurationItem.value !== undefined) {
$(element).prop('checked',configurationItem.value);
}
}
countElementArray++;
}else {
// For all others form-elements the general script is used. anyway the formgroup error is needed to be fixed.
// For all other form-elements the general script is used.
element = n.Element.getElement(formElementName);
// Cleaner way to set states for tinymce
// This triggers the event on the unaccesable textarea
......@@ -1292,8 +1297,6 @@ var QfqNS = QfqNS || {};
}
countElementArray = 0;
}
} catch (e) {
n.Log.error(e.message);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment