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
73205edc
Commit
73205edc
authored
Jan 07, 2019
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify rerender
parent
12d8ca64
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
15 deletions
+25
-15
demo/xmla_connection/index.js
demo/xmla_connection/index.js
+7
-15
jsonform.gadget.js
jsonform.gadget.js
+18
-0
No files found.
demo/xmla_connection/index.js
View file @
73205edc
...
...
@@ -247,25 +247,17 @@
gadget_settings
,
path
;
function
f
(
p
)
{
var
settings
;
function
f
(
settings_path
,
rerender_path
)
{
return
g
.
getDeclaredGadget
(
"
xmla_settings
"
)
.
push
(
function
(
gadget
)
{
gadget_settings
=
gadget
;
return
gadget
.
getContent
(
p
);
return
gadget
.
getContent
(
settings_path
);
})
.
push
(
function
(
c
)
{
settings
=
c
;
return
generateSchema
(
c
);
.
push
(
function
(
settings
)
{
return
generateSchema
(
settings
);
})
.
push
(
function
(
schema
)
{
return
gadget_settings
.
getGadgetByPath
(
p
+
'
/properties
'
)
.
push
(
function
(
ret
)
{
return
ret
.
gadget
.
rerender
({
schema
:
schema
,
value
:
convertOnMultiLevel
(
settings
,
'
/properties
'
)
});
});
return
gadget_settings
.
rerender
(
rerender_path
,
schema
);
})
.
push
(
function
()
{
// return g.notifyChange();
...
...
@@ -275,7 +267,7 @@
for
(
path
in
g
.
props
.
xmla_connections
)
{
if
(
g
.
props
.
xmla_connections
.
hasOwnProperty
(
path
)
&&
p
.
startsWith
(
path
))
{
return
f
(
path
);
return
f
(
path
,
g
.
props
.
xmla_connections
[
path
]
);
}
}
// return g.notifyChange();
...
...
@@ -301,7 +293,7 @@
return
generateSchema
(
settings
);
})
.
push
(
function
(
s
)
{
g
.
props
.
xmla_connections
[
connection_path
]
=
false
;
g
.
props
.
xmla_connections
[
connection_path
]
=
path
;
return
s
;
});
}
...
...
jsonform.gadget.js
View file @
73205edc
...
...
@@ -935,6 +935,24 @@
return
g
;
});
})
.
declareMethod
(
'
rerender
'
,
function
(
path
,
schema
)
{
var
g
=
this
,
gadget
;
if
(
path
)
{
return
g
.
props
.
form_gadget
.
getGadgetByPath
(
path
)
.
push
(
function
(
ret
)
{
gadget
=
ret
.
gadget
;
return
gadget
.
getContent
();
})
.
push
(
function
(
value
)
{
return
gadget
.
rerender
({
schema
:
schema
,
value
:
value
});
});
}
})
.
allowPublicAcquisition
(
"
expandSchema
"
,
function
(
arr
)
{
return
expandSchemaForField
(
this
,
arr
[
0
],
arr
[
1
],
arr
[
2
],
arr
[
3
]);
})
...
...
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