File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Client-Side Components/UI Macros/JSON Formatter and Viewer Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+ <j : jelly trim =" false" xmlns : j =" jelly:core" xmlns : g =" glide" xmlns : j2 =" jelly:html" xmlns : g2 =" glide.ui" >
3+
4+ <g : evaluate var =" jvar_field_name" expression =" RP.getWindowProperties().get('fieldName')" />
5+
6+ <button type =" button"
7+ onclick =" openJsonViewer('${jvar_field_name}');"
8+ title =" View and Format JSON"
9+ class =" btn btn-default btn-sm" >
10+ <span class =" icon-code" ></span > JSON Viewer
11+ </button >
12+
13+ <script >
14+ function openJsonViewer(fieldName) {
15+ var jsonValue = g_form.getValue(fieldName);
16+ var gm = new GlideModal('json_viewer_ui_page', false); // Replace 'json_viewer_ui_page' with your actual UI Page or Widget ID
17+ gm.setTitle('JSON Data Viewer & Formatter for Field: ' + fieldName);
18+ gm.setPreference('json_data', jsonValue);
19+ gm.setSize(900);
20+ gm.render();
21+ }
22+ </script >
23+ </j : jelly >
You can’t perform that action at this time.
0 commit comments