From 661ff923e924030dd082ae580228f1174084224f Mon Sep 17 00:00:00 2001 From: "Jason.Chuah" Date: Fri, 7 Jul 2023 22:10:15 +0800 Subject: [PATCH] enhancement: add getData() support --- src/js/brutusin-json-forms.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/js/brutusin-json-forms.js b/src/js/brutusin-json-forms.js index 1f99f9c..64b4d34 100644 --- a/src/js/brutusin-json-forms.js +++ b/src/js/brutusin-json-forms.js @@ -936,6 +936,7 @@ if (typeof brutusin === "undefined") { return object; } } + if (!container) { return null; } else { @@ -1339,6 +1340,14 @@ if (typeof brutusin === "undefined") { } else { value = null; } + } else if (schema.format === "radio") { + value = null; + for (var i = 0; i < input.childElementCount; i++) { + if (input.childNodes[i].tagName === "INPUT" && input.childNodes[i].checked) { + value = input.childNodes[i].value; + break; + } + } } } else if (schema.type === "any") { if (value) {