MVC - Bootgrid / form control minor additions. minor fix for 528474372b373c720962e5efaad3c7cf6773917a moving formatters out of <input> section so types like checkboxes may also be converted if needed

This commit is contained in:
Ad Schellevis 2022-10-20 16:54:06 +02:00
parent b55c77d751
commit 63cd61ffd2

View File

@ -96,14 +96,14 @@ function getFormData(parent) {
// deserialize the field content - used for JS maintained fields
node[keypart] = sourceNode.data('data');
} else {
// regular input type, might need a parser to convert to the correct format
// (attribute type_formatter as function name)
if (sourceNode.attr('type_formatter') !== undefined && window[sourceNode.attr('type_formatter')] !== undefined) {
node[keypart] = window[sourceNode.attr('type_formatter')](sourceNode.val());
} else {
node[keypart] = sourceNode.val();
}
node[keypart] = sourceNode.val();
}
// Might need a parser to convert to the correct format
// (attribute type_formatter as function name)
if (sourceNode.attr('type_formatter') !== undefined && window[sourceNode.attr('type_formatter')] !== undefined) {
node[keypart] = window[sourceNode.attr('type_formatter')](node[keypart]);
}
}
});
});