NotVisible based statuses and roles
Inside the notVisible property we have ability to hide the current field based the user role(s) and status(es)
[
{
"formName": "formName_01"
},
{
"groups": [
{
"groupName": "Informazioni Generali",
"tabName": "Dati pratica",
"tab": true,
"column": true,
"content": {
"rows": [
{
"name": "firstRow",
"column": true,
"fields": [
{
"Type": "string",
"id": "example_1",
"label": "Shoud be hidden if the status is Preventivo calcolato",
"visible": true,
"readOnly": false,
"notVisible": {
"statuses": [
"Preventivo calcolato"
]
}
},
{
"Type": "string",
"id": "example_2",
"label": "houd be hidden if the role is admin",
"visible": true,
"readOnly": false,
"notVisible": {
"roles": [
"admin"
]
}
}
]
}
]
}
}
]
},
{
"conditions": []
}
]
<!DOCTYPE html>
<html lang="en">
<head>
<!-- load plugin style -->
<link
href="https://plugins.wedat.eu/form-builder/plugin.css"
rel="stylesheet"
/>
</head>
<body>
<!-- this place where plugin will render -->
<div class="plugin"></div>
<!-- load plugin JS synchronously -->
<script src="https://plugins.wedat.eu/form-builder/plugin.js"></script>
<!-- init plugin options on your JS file or inline JS like this -->
<script>
window.FORM_BUILDER.init({
selector: '.plugin',
onComplete: res => {
// make what your want :)
console.log(res);
},
data: [
{
"formName": "formName_01"
},
{
"groups": [
{
"groupName": "Informazioni Generali",
"tabName": "Dati pratica",
"tab": true,
"column": true,
"content": {
"rows": [
{
"name": "firstRow",
"column": true,
"fields": [
{
"Type": "string",
"id": "example_1",
"label": "Shoud be hidden if the status is Preventivo calcolato",
"visible": true,
"readOnly": false,
"notVisible": {
"statuses": ["Preventivo calcolato"],
}
},
{
"Type": "string",
"id": "example_2",
"label": "houd be hidden if the role is admin",
"visible": true,
"readOnly": false,
"notVisible": {
"roles": ["admin"],
}
}
]
}
]
}
}
]
}
]
options: {} // page options
});
</script>
</body>
</html>