Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rjs_json_form
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
rjs_json_form
Commits
5819ba7b
Commit
5819ba7b
authored
Jan 01, 2019
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getContent can be return part of json document
parent
b2706afe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
jsonform.gadget.js
jsonform.gadget.js
+21
-1
No files found.
jsonform.gadget.js
View file @
5819ba7b
...
...
@@ -648,6 +648,23 @@
.
push
(
schema_arr_marker
);
}
function
convertOnMultiLevel
(
d
,
key
)
{
var
ii
,
kk
,
key_list
=
key
.
split
(
"
/
"
);
for
(
ii
=
1
;
ii
<
key_list
.
length
;
ii
+=
1
)
{
kk
=
decodeJsonPointer
(
key_list
[
ii
]);
if
(
ii
===
key_list
.
length
-
1
)
{
return
d
[
kk
];
}
else
{
if
(
!
d
.
hasOwnProperty
(
kk
))
{
return
;
}
d
=
d
[
kk
];
}
}
}
rJS
(
window
)
.
ready
(
function
()
{
var
g
=
this
;
...
...
@@ -925,7 +942,7 @@
}
},
500
)
.
declareMethod
(
'
getContent
'
,
function
()
{
.
declareMethod
(
'
getContent
'
,
function
(
sub_path
)
{
var
g
=
this
;
if
(
g
.
state
.
editable
)
{
return
g
.
props
.
form_gadget
.
getContent
()
...
...
@@ -935,6 +952,9 @@
// its parent call render with the same value
// (as ERP5 does in case of formulator error)
g
.
state
.
value
=
JSON
.
stringify
(
value
);
if
(
sub_path
)
{
value
=
convertOnMultiLevel
(
value
,
sub_path
);
}
if
(
g
.
state
.
key
)
{
var
form_data
=
{};
value
=
JSON
.
stringify
(
value
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment