-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic Schema issues in array #101
base: master
Are you sure you want to change the base?
Conversation
@@ -177,6 +177,7 @@ if (typeof brutusin === "undefined") { | |||
} else if (s.media) { | |||
input = document.createElement("input"); | |||
input.type = "file"; | |||
appendChild(input, option, s); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addition of this line is unintended. I will remove this line from my version and resubmit the pull request.
} else if (s.format === "date") { | ||
input.type = "date"; | ||
} else if (s.format === "time") { | ||
input.type = "time"; | ||
} else if (s.format === "email") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deletion of above 4 lines unintended. Will add these in my version and re-submit the pull request.
@@ -204,7 +205,7 @@ if (typeof brutusin === "undefined") { | |||
} | |||
} | |||
if (s.enum.length === 1) | |||
input.selectedIndex = 0; | |||
input.selectedIndex = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be:
input.selectedIndex = 0;
Will change and re-submit
src/js/brutusin-json-forms.js
Outdated
if (value === true || value !== false && s.default) { | ||
input.checked = true; | ||
if (value === true) { | ||
input.checked = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in above 2 lines are unintended. Will revert and re-submit
@@ -1311,7 +1307,7 @@ if (typeof brutusin === "undefined") { | |||
|
|||
function cleanSchemaMap(schemaId) { | |||
for (var prop in schemaMap) { | |||
if (prop.startsWith(schemaId)) { | |||
if (prop.startsWith(schemaId)) { // 02_AddLevel1Item_Delete_AgainAdd.png | |||
delete schemaMap[prop]; | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surprisingly, in the origin itself, the code differs between src
and dist
!!!
src
has this fix... but dist
doesn't have the fix.
@nagarajanchinnasamy Thank you this pull request fixed all my open issues. |
thank you! fixed issues i had as well with dynamically build arrays with distinct fieldnames |
thank you very much for the implementation! With the getData method, the generated elements are not displayed. The error occurs when the first element had an addition and the next element makes a schema change. Than getData has the result: With only one Entry the result is: How did you fix the problem? Does it happen to you too? |
When using
dependsOn
between properties of an object placed in an array, encountered various issues. Please use the examples provided in examples folder to test scenarios below:Issue 1:
When an item is added by clicking Add Item button, received
Uncaught Type Error: element.equals is not a function
exception.Issue 2:
After fixing issue-1, using the following steps:
received
Uncaught TypeError: cannot read property 'type' of undefined
exceptionIssue 3:
After fixing issue-2, using the following steps (in example2.html):
received
Uncaught TypeError: cannot read property '$ref' of undefined
exception.Issue 4:
After fixing issue-3, noticed that, dependency change is effective only in the last item of the array. Other items do not react to change in the drop-down value. This I feel something to do with depencyMap. But could not figure out a solution for this. Need help. Thanks.