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
93224584
Commit
93224584
authored
Sep 21, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add gadget_complex_demo_form.*
parent
d0e105f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
151 additions
and
0 deletions
+151
-0
demo/gadget_complex_demo_form.html
demo/gadget_complex_demo_form.html
+59
-0
demo/gadget_complex_demo_form.js
demo/gadget_complex_demo_form.js
+92
-0
No files found.
demo/gadget_complex_demo_form.html
0 → 100644
View file @
93224584
<!doctype html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Demo UI OLAP Query editor based on JSON Schema form generator
</title>
<link
rel=
"stylesheet"
href=
"../gadget_erp5_nojqm.css"
>
<script
src=
"../rsvp.js"
></script>
<script
src=
"../renderjs.js"
></script>
<script
src=
"../jio.js"
></script>
<script
src=
"gadget_complex_demo_form.js"
></script>
</head>
<body>
<div
data-role=
"page"
>
<div
role=
"main"
class=
"ui-content gadget-content"
>
<section
class=
"ui-content-header-plain"
>
<h3
class=
"ui-content-title ui-body-c"
>
Demo UI OLAP Query editor based on JSON Schema form generator
</h3>
</section>
<div
data-gadget-url=
"../jsonform.gadget.html"
data-gadget-scope=
"columns"
data-gadget-sandbox=
"public"
></div>
<div
data-gadget-url=
"../jsonform.gadget.html"
data-gadget-scope=
"rows"
data-gadget-sandbox=
"public"
></div>
<br>
<div
class=
"ui-body-c"
>
<div
class=
"field_container"
>
<div
class=
"left"
>
<div
class=
"ui-field-contain"
>
<div
data-gadget-url=
"../jsonform.gadget.html"
data-gadget-scope=
"form_view"
data-gadget-sandbox=
"public"
>
</div>
</div>
</div>
<div
class=
"right"
>
<div
class=
"ui-field-contain"
>
<label
for=
"json_document_content"
>
OLAP query settings
</label>
<textarea
name=
"json_document_content"
id=
"json_document_content"
title=
"Json Document"
spellcheck=
"false"
style=
"height: 1024px;font-family:Consolas,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New, monospace;"
readonly
></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
demo/gadget_complex_demo_form.js
0 → 100644
View file @
93224584
/*jslint nomen: true, maxlen: 200, indent: 2*/
/*global rJS, console, window, document, RSVP, jIO*/
(
function
(
window
,
rJS
,
jIO
)
{
"
use strict
"
;
function
transform_olap_dimensions
(
g
,
dimensions
)
{
var
dimension
;
for
(
dimension
in
dimensions
)
{
if
(
dimensions
.
hasOwnProperty
(
dimension
))
{
}
}
}
function
generate_schema
()
{
}
function
render_form
(
gadget
,
scope
,
schema
)
{
return
gadget
.
getDeclaredGadget
(
scope
)
.
push
(
function
(
g
)
{
return
g
.
render
({
schema
:
schema
});
});
}
rJS
(
window
)
.
ready
(
function
(
g
)
{
g
.
props
=
{};
g
.
props
.
dimensions
=
{
"
Time
"
:
[
{
title
:
'
Year
'
,
const
:
'
[Time].[Time].[Year]
'
},
{
title
:
'
Quarter
'
,
const
:
'
[Time].[Time].[Quarter]
'
}
],
"
Product
"
:
[
{
title
:
'
Product Family
'
,
const
:
'
[Product].[Products].[Product Family]
'
},
{
title
:
'
Product Department
'
,
const
:
'
[Product].[Products].[Product Department]
'
},
{
title
:
'
Product Category
'
,
const
:
'
[Product].[Products].[Product Category]
'
}
]
};
g
.
props
.
dimensions
=
[
{
title
:
'
Year
'
,
const
:
'
[Time].[Time].[Year]
'
},
{
title
:
'
Quarter
'
,
const
:
'
[Time].[Time].[Quarter]
'
},
{
title
:
'
Product Family
'
,
const
:
'
[Product].[Products].[Product Family]
'
},
{
title
:
'
Product Department
'
,
const
:
'
[Product].[Products].[Product Department]
'
},
{
title
:
'
Product Category
'
,
const
:
'
[Product].[Products].[Product Category]
'
}
];
return
RSVP
.
all
([
render_form
(
g
,
"
columns
"
,
{
title
:
"
columns:
"
,
type
:
"
array
"
,
items
:
{
oneOf
:
g
.
props
.
dimensions
}
}),
render_form
(
g
,
"
rows
"
,
{
title
:
"
rows:
"
,
type
:
"
array
"
,
items
:
{
oneOf
:
g
.
props
.
dimensions
}
})
]);
})
.
allowPublicAcquisition
(
"
notifyValid
"
,
function
(
arr
,
scope
)
{
})
.
allowPublicAcquisition
(
"
notifyInvalid
"
,
function
(
arr
,
scope
)
{
})
.
allowPublicAcquisition
(
"
notifyChange
"
,
function
(
arr
,
scope
)
{
var
gadget
=
this
;
if
([
'
rows
'
,
'
columns
'
].
indexOf
(
scope
)
>=
0
)
{
return
this
.
getDeclaredGadget
(
scope
)
.
push
(
function
(
g
)
{
return
g
.
getContent
();
})
.
push
(
function
(
ret
)
{
var
z
=
{};
z
[
scope
]
=
ret
;
return
gadget
.
changeState
(
z
);
});
}
})
.
onStateChange
(
function
()
{
var
g
=
this
;
document
.
getElementById
(
"
json_document_content
"
).
textContent
=
JSON
.
stringify
(
g
.
state
,
null
,
2
);
});
}(
window
,
rJS
,
jIO
));
\ No newline at end of file
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