Description
Environment
Please provide as many details as you can:
Stackblitz link :: https://stackblitz.com/edit/angular-formio-datagrid-modal-edit
I am trying out data grid, there are too many columns in my case.
So, to make the look & feel better I have selected the Modal Edit option in data grid such that the user will fill the form in Modal and when they click on save, we'll set the values automatically in the table. My goal was to open this modal and let user fill when ever they add new Row.
There are number of issues ::
-
The Add new button is not coming up in the stackblitz but coming up in my local with same JSON - we can ignore this
-
The Modal edit as shown in builder preview is not appearing in the actual rendered form. (Attached builder preview screenshot below)
-
Is there any way, I can make the columns multi line automatically for responsiveness ? (I am adding a panel and columns inside datagrid as a workaround for now)
- Hosting type
- Form.io
- Local deployment
- Formio.js version: 4.12.1
- angular-formio version : 4.11.1
- Frontend- Angular version: 10.2 (tried in Angular 8.3, getting same issue)
- Browser: Chrome
- Browser version: Chrome 86.0
Steps to Reproduce
- Open https://stackblitz.com/edit/angular-formio-datagrid-modal-edit
- Feed the JSON to the builder.
- Compare the builder preview with the actual rendered form
Expected behavior
- I am just trying to understand if its possible to fill the form fields in a modal and when user clicks on save, the details should be updated in the grid.
Observed behavior
- At least, the builder preview and rendered form should match
Example
If possible, please provide a screenshot, live example (via JSFiddle or similar), and/or example code to help demonstrate the issue.
For code or form JSON, please enclose in a code block:
const formJson = {
display: "wizard",
page: 0,
numPages: 2,
components: [
{
title: "Page 1",
label: "Page 1",
type: "panel",
key: "page1",
components: [
{
label: "Data Grid",
labelPosition: "top",
description: "",
tooltip: "",
disableAddingRemovingRows: false,
conditionalAddButton: "",
reorder: false,
addAnother: "",
addAnotherPosition: "bottom",
defaultOpen: false,
layoutFixed: false,
enableRowGroups: false,
initEmpty: false,
customClass: "",
tabindex: "",
hidden: false,
hideLabel: false,
autofocus: false,
disabled: false,
tableView: false,
modalEdit: true,
defaultValue: [
{
textField: "",
textField1: "",
textField2: "",
textField3: "",
textField4: "",
textField5: "",
textField6: "",
textField7: "",
textField8: "",
textField9: "",
textField10: "",
textField11: "",
textField12: ""
}
],
persistent: true,
protected: false,
dbIndex: false,
encrypted: false,
redrawOn: "",
clearOnHide: true,
customDefaultValue: "",
calculateValue: "",
calculateServer: false,
allowCalculateOverride: false,
validateOn: "change",
validate: {
required: false,
minLength: "",
maxLength: "",
customMessage: "",
custom: "",
customPrivate: false,
json: "",
strictDateValidation: false,
multiple: false,
unique: false
},
unique: false,
errorLabel: "",
key: "dataGrid",
tags: [],
properties: {},
conditional: { show: null, when: null, eq: "", json: "" },
customConditional: "",
logic: [],
attributes: {},
overlay: {
style: "",
page: "",
left: "",
top: "",
width: "",
height: ""
},
type: "datagrid",
input: true,
components: [
{
label: "Text Field",
tableView: true,
key: "textField",
type: "textfield",
input: true,
placeholder: "",
prefix: "",
customClass: "",
suffix: "",
multiple: false,
defaultValue: null,
protected: false,
unique: false,
persistent: true,
hidden: false,
clearOnHide: true,
refreshOn: "",
redrawOn: "",
modalEdit: false,
labelPosition: "top",
description: "",
errorLabel: "",
tooltip: "",
hideLabel: false,
tabindex: "",
disabled: false,
autofocus: false,
dbIndex: false,
customDefaultValue: "",
calculateValue: "",
calculateServer: false,
widget: { type: "input" },
attributes: {},
validateOn: "change",
validate: {
required: false,
custom: "",
customPrivate: false,
strictDateValidation: false,
multiple: false,
unique: false,
minLength: "",
maxLength: "",
pattern: ""
},
conditional: { show: null, when: null, eq: "" },
overlay: {
style: "",
left: "",
top: "",
width: "",
height: ""
},
allowCalculateOverride: false,
encrypted: false,
showCharCount: false,
showWordCount: false,
properties: {},
allowMultipleMasks: false,
mask: false,
inputType: "text",
inputFormat: "plain",
inputMask: "",
spellcheck: true,
id: "e18u6p0000"
},
{
label: "Text Field",
tableView: true,
key: "textField1",
type: "textfield",
input: true,
placeholder: "",
prefix: "",
customClass: "",
suffix: "",
multiple: false,
defaultValue: null,
protected: false,
unique: false,
persistent: true,
hidden: false,
clearOnHide: true,
refreshOn: "",
redrawOn: "",
modalEdit: false,
labelPosition: "top",
description: "",
errorLabel: "",
tooltip: "",
hideLabel: false,
tabindex: "",
disabled: false,
autofocus: false,
dbIndex: false,
customDefaultValue: "",
calculateValue: "",
calculateServer: false,
widget: { type: "input" },
attributes: {},
validateOn: "change",
validate: {
required: false,
custom: "",
customPrivate: false,
strictDateValidation: false,
multiple: false,
unique: false,
minLength: "",
maxLength: "",
pattern: ""
},
conditional: { show: null, when: null, eq: "" },
overlay: {
style: "",
left: "",
top: "",
width: "",
height: ""
},
allowCalculateOverride: false,
encrypted: false,
showCharCount: false,
showWordCount: false,
properties: {},
allowMultipleMasks: false,
mask: false,
inputType: "text",
inputFormat: "plain",
inputMask: "",
spellcheck: true,
id: "ertl25d0000"
},
{
label: "Text Field",
tableView: true,
key: "textField2",
type: "textfield",
input: true,
placeholder: "",
prefix: "",
customClass: "",
suffix: "",
multiple: false,
defaultValue: null,
protected: false,
unique: false,
persistent: true,
hidden: false,
clearOnHide: true,
refreshOn: "",
redrawOn: "",
modalEdit: false,
labelPosition: "top",
description: "",
errorLabel: "",
tooltip: "",
hideLabel: false,
tabindex: "",
disabled: false,
autofocus: false,
dbIndex: false,
customDefaultValue: "",
calculateValue: "",
calculateServer: false,
widget: { type: "input" },
attributes: {},
validateOn: "change",
validate: {
required: false,
custom: "",
customPrivate: false,
strictDateValidation: false,
multiple: false,
unique: false,
minLength: "",
maxLength: "",
pattern: ""
},
conditional: { show: null, when: null, eq: "" },
overlay: {
style: "",
left: "",
top: "",
width: "",
height: ""
},
allowCalculateOverride: false,
encrypted: false,
showCharCount: false,
showWordCount: false,
properties: {},
allowMultipleMasks: false,
mask: false,
inputType: "text",
inputFormat: "plain",
inputMask: "",
spellcheck: true,
id: "enkj3hj0000"
},
{
label: "Text Field",
tableView: true,
key: "textField3",
type: "textfield",
input: true,
placeholder: "",
prefix: "",
customClass: "",
suffix: "",
multiple: false,
defaultValue: null,
protected: false,
unique: false,
persistent: true,
hidden: false,
clearOnHide: true,
refreshOn: "",
redrawOn: "",
modalEdit: false,
labelPosition: "top",
description: "",
errorLabel: "",
tooltip: "",
hideLabel: false,
tabindex: "",
disabled: false,
autofocus: false,
dbIndex: false,
customDefaultValue: "",
calculateValue: "",
calculateServer: false,
widget: { type: "input" },
attributes: {},
validateOn: "change",
validate: {
required: false,
custom: "",
customPrivate: false,
strictDateValidation: false,
multiple: false,
unique: false,
minLength: "",
maxLength: "",
pattern: ""
},
conditional: { show: null, when: null, eq: "" },
overlay: {
style: "",
left: "",
top: "",
width: "",
height: ""
},
allowCalculateOverride: false,
encrypted: false,
showCharCount: false,
showWordCount: false,
properties: {},
allowMultipleMasks: false,
mask: false,
inputType: "text",
inputFormat: "plain",
inputMask: "",
spellcheck: true,
id: "e8mo7xl0000"
},
{
label: "Text Field",
tableView: true,
key: "textField4",
type: "textfield",
input: true,
placeholder: "",
prefix: "",
customClass: "",
suffix: "",
multiple: false,
defaultValue: null,
protected: false,
unique: false,
persistent: true,
hidden: false,
clearOnHide: true,
refreshOn: "",
redrawOn: "",
modalEdit: false,
labelPosition: "top",
description: "",
errorLabel: "",
tooltip: "",
hideLabel: false,
tabindex: "",
disabled: false,
autofocus: false,
dbIndex: false,
customDefaultValue: "",
calculateValue: "",
calculateServer: false,
widget: { type: "input" },
attributes: {},
validateOn: "change",
validate: {
required: false,
custom: "",
customPrivate: false,
strictDateValidation: false,
multiple: false,
unique: false,
minLength: "",
maxLength: "",
pattern: ""
},
conditional: { show: null, when: null, eq: "" },
overlay: {
style: "",
left: "",
top: "",
width: "",
height: ""
},
allowCalculateOverride: false,
encrypted: false,
showCharCount: false,
showWordCount: false,
properties: {},
allowMultipleMasks: false,
mask: false,
inputType: "text",
inputFormat: "plain",
inputMask: "",
spellcheck: true,
id: "eb8dg7ea0000"
},
{
label: "Text Field",
tableView: true,
key: "textField5",
type: "textfield",
input: true,
placeholder: "",
prefix: "",
customClass: "",
suffix: "",
multiple: false,
defaultValue: null,
protected: false,
unique: false,
persistent: true,
hidden: false,
clearOnHide: true,
refreshOn: "",
redrawOn: "",
modalEdit: false,
labelPosition: "top",
description: "",
errorLabel: "",
tooltip: "",
hideLabel: false,
tabindex: "",
disabled: false,
autofocus: false,
dbIndex: false,
customDefaultValue: "",
calculateValue: "",
calculateServer: false,
widget: { type: "input" },
attributes: {},
validateOn: "change",
validate: {
required: false,
custom: "",
customPrivate: false,
strictDateValidation: false,
multiple: false,
unique: false,
minLength: "",
maxLength: "",
pattern: ""
},
conditional: { show: null, when: null, eq: "" },
overlay: {
style: "",
left: "",
top: "",
width: "",
height: ""
},
allowCalculateOverride: false,
encrypted: false,
showCharCount: false,
showWordCount: false,
properties: {},
allowMultipleMasks: false,
mask: false,
inputType: "text",
inputFormat: "plain",
inputMask: "",
spellcheck: true,
id: "ezjw4zd0000"
},
{
label: "Text Field",
tableView: true,
key: "textField6",
type: "textfield",
input: true,
placeholder: "",
prefix: "",
customClass: "",
suffix: "",
multiple: false,
defaultValue: null,
protected: false,
unique: false,
persistent: true,
hidden: false,
clearOnHide: true,
refreshOn: "",
redrawOn: "",
modalEdit: false,
labelPosition: "top",
description: "",
errorLabel: "",
tooltip: "",
hideLabel: false,
tabindex: "",
disabled: false,
autofocus: false,
dbIndex: false,
customDefaultValue: "",
calculateValue: "",
calculateServer: false,
widget: { type: "input" },
attributes: {},
validateOn: "change",
validate: {
required: false,
custom: "",
customPrivate: false,
strictDateValidation: false,
multiple: false,
unique: false,
minLength: "",
maxLength: "",
pattern: ""
},
conditional: { show: null, when: null, eq: "" },
overlay: {
style: "",
left: "",
top: "",
width: "",
height: ""
},
allowCalculateOverride: false,
encrypted: false,
showCharCount: false,
showWordCount: false,
properties: {},
allowMultipleMasks: false,
mask: false,
inputType: "text",
inputFormat: "plain",
inputMask: "",
spellcheck: true,
id: "ebn8ep10000"
},
{
label: "Text Field",
tableView: true,
key: "textField7",
type: "textfield",
input: true,
placeholder: "",
prefix: "",
customClass: "",
suffix: "",
multiple: false,
defaultValue: null,
protected: false,
unique: false,
persistent: true,
hidden: false,
clearOnHide: true,
refreshOn: "",
redrawOn: "",
modalEdit: false,
labelPosition: "top",
description: "",
errorLabel: "",
tooltip: "",
hideLabel: false,
tabindex: "",
disabled: false,
autofocus: false,
dbIndex: false,
customDefaultValue: "",
calculateValue: "",
calculateServer: false,
widget: { type: "input" },
attributes: {},
validateOn: "change",
validate: {
required: false,
custom: "",
customPrivate: false,
strictDateValidation: false,
multiple: false,
unique: false,
minLength: "",
maxLength: "",
pattern: ""
},
conditional: { show: null, when: null, eq: "" },
overlay: {
style: "",
left: "",
top: "",
width: "",
height: ""
},
allowCalculateOverride: false,
encrypted: false,
showCharCount: false,
showWordCount: false,
properties: {},
allowMultipleMasks: false,
mask: false,
inputType: "text",
inputFormat: "plain",
inputMask: "",
spellcheck: true,
id: "esb4r0mp0000"
},
{
label: "Text Field",
tableView: true,
key: "textField8",
type: "textfield",
input: true,
placeholder: "",
prefix: "",
customClass: "",
suffix: "",
multiple: false,
defaultValue: null,
protected: false,
unique: false,
persistent: true,
hidden: false,
clearOnHide: true,
refreshOn: "",
redrawOn: "",
modalEdit: false,
labelPosition: "top",
description: "",
errorLabel: "",
tooltip: "",
hideLabel: false,
tabindex: "",
disabled: false,
autofocus: false,
dbIndex: false,
customDefaultValue: "",
calculateValue: "",
calculateServer: false,
widget: { type: "input" },
attributes: {},
validateOn: "change",
validate: {
required: false,
custom: "",
customPrivate: false,
strictDateValidation: false,
multiple: false,
unique: false,
minLength: "",
maxLength: "",
pattern: ""
},
conditional: { show: null, when: null, eq: "" },
overlay: {
style: "",
left: "",
top: "",
width: "",
height: ""
},
allowCalculateOverride: false,
encrypted: false,
showCharCount: false,
showWordCount: false,
properties: {},
allowMultipleMasks: false,
mask: false,
inputType: "text",
inputFormat: "plain",
inputMask: "",
spellcheck: true,
id: "eu0uzk0000"
},
{
label: "Text Field",
tableView: true,
key: "textField9",
type: "textfield",
input: true,
placeholder: "",
prefix: "",
customClass: "",
suffix: "",
multiple: false,
defaultValue: null,
protected: false,
unique: false,
persistent: true,
hidden: false,
clearOnHide: true,
refreshOn: "",
redrawOn: "",
modalEdit: false,
labelPosition: "top",
description: "",
errorLabel: "",
tooltip: "",
hideLabel: false,
tabindex: "",
disabled: false,
autofocus: false,
dbIndex: false,
customDefaultValue: "",
calculateValue: "",
calculateServer: false,
widget: { type: "input" },
attributes: {},
validateOn: "change",
validate: {
required: false,
custom: "",
customPrivate: false,
strictDateValidation: false,
multiple: false,
unique: false,
minLength: "",
maxLength: "",
pattern: ""
},
conditional: { show: null, when: null, eq: "" },
overlay: {
style: "",
left: "",
top: "",
width: "",
height: ""
},
allowCalculateOverride: false,
encrypted: false,
showCharCount: false,
showWordCount: false,
properties: {},
allowMultipleMasks: false,
mask: false,
inputType: "text",
inputFormat: "plain",
inputMask: "",
spellcheck: true,
id: "ei5m1yb0000"
},
{
label: "Text Field",
tableView: true,
key: "textField10",
type: "textfield",
input: true,
placeholder: "",
prefix: "",
customClass: "",
suffix: "",
multiple: false,
defaultValue: null,
protected: false,
unique: false,
persistent: true,
hidden: false,
clearOnHide: true,
refreshOn: "",
redrawOn: "",
modalEdit: false,
labelPosition: "top",
description: "",
errorLabel: "",
tooltip: "",
hideLabel: false,
tabindex: "",
disabled: false,
autofocus: false,
dbIndex: false,
customDefaultValue: "",
calculateValue: "",
calculateServer: false,
widget: { type: "input" },
attributes: {},
validateOn: "change",
validate: {
required: false,
custom: "",
customPrivate: false,
strictDateValidation: false,
multiple: false,
unique: false,
minLength: "",
maxLength: "",
pattern: ""
},
conditional: { show: null, when: null, eq: "" },
overlay: {
style: "",
left: "",
top: "",
width: "",
height: ""
},
allowCalculateOverride: false,
encrypted: false,
showCharCount: false,
showWordCount: false,
properties: {},
allowMultipleMasks: false,
mask: false,
inputType: "text",
inputFormat: "plain",
inputMask: "",
spellcheck: true,
id: "ex462i0000"
},
{
label: "Text Field",
tableView: true,
key: "textField11",
type: "textfield",
input: true,
placeholder: "",
prefix: "",
customClass: "",
suffix: "",
multiple: false,
defaultValue: null,
protected: false,
unique: false,
persistent: true,
hidden: false,
clearOnHide: true,
refreshOn: "",
redrawOn: "",
modalEdit: false,
labelPosition: "top",
description: "",
errorLabel: "",
tooltip: "",
hideLabel: false,
tabindex: "",
disabled: false,
autofocus: false,
dbIndex: false,
customDefaultValue: "",
calculateValue: "",
calculateServer: false,
widget: { type: "input" },
attributes: {},
validateOn: "change",
validate: {
required: false,
custom: "",
customPrivate: false,
strictDateValidation: false,
multiple: false,
unique: false,
minLength: "",
maxLength: "",
pattern: ""
},
conditional: { show: null, when: null, eq: "" },
overlay: {
style: "",
left: "",
top: "",
width: "",
height: ""
},
allowCalculateOverride: false,
encrypted: false,
showCharCount: false,
showWordCount: false,
properties: {},
allowMultipleMasks: false,
mask: false,
inputType: "text",
inputFormat: "plain",
inputMask: "",
spellcheck: true,
id: "e1xgvh50000"
},
{
label: "Text Field",
tableView: true,
key: "textField12",
type: "textfield",
input: true,
placeholder: "",
prefix: "",
customClass: "",
suffix: "",
multiple: false,
defaultValue: null,
protected: false,
unique: false,
persistent: true,
hidden: false,
clearOnHide: true,
refreshOn: "",
redrawOn: "",
modalEdit: false,
labelPosition: "top",
description: "",
errorLabel: "",
tooltip: "",
hideLabel: false,
tabindex: "",
disabled: false,
autofocus: false,
dbIndex: false,
customDefaultValue: "",
calculateValue: "",
calculateServer: false,
widget: { type: "input" },
attributes: {},
validateOn: "change",
validate: {
required: false,
custom: "",
customPrivate: false,
strictDateValidation: false,
multiple: false,
unique: false,
minLength: "",
maxLength: "",
pattern: ""
},
conditional: { show: null, when: null, eq: "" },
overlay: {
style: "",
left: "",
top: "",
width: "",
height: ""
},
allowCalculateOverride: false,
encrypted: false,
showCharCount: false,
showWordCount: false,
properties: {},
allowMultipleMasks: false,
mask: false,
inputType: "text",
inputFormat: "plain",
inputMask: "",
spellcheck: true,
id: "e2jiu9p0000"
}
],
placeholder: "",
prefix: "",
suffix: "",
multiple: false,
refreshOn: "",
widget: null,
showCharCount: false,
showWordCount: false,
allowMultipleMasks: false,
tree: true,
id: "eohomd8"
}
],
input: false,
placeholder: "",
prefix: "",
customClass: "",
suffix: "",
multiple: false,
defaultValue: null,
protected: false,
unique: false,
persistent: false,
hidden: false,
clearOnHide: false,
refreshOn: "",
redrawOn: "",
tableView: false,
modalEdit: false,
labelPosition: "top",
description: "",
errorLabel: "",
tooltip: "",
hideLabel: false,
tabindex: "",
disabled: false,
autofocus: false,
dbIndex: false,
customDefaultValue: "",
calculateValue: "",
calculateServer: false,
widget: null,
attributes: {},
validateOn: "change",
validate: {
required: false,
custom: "",
customPrivate: false,
strictDateValidation: false,
multiple: false,
unique: false
},
conditional: { show: null, when: null, eq: "" },
overlay: { style: "", left: "", top: "", width: "", height: "" },
allowCalculateOverride: false,
encrypted: false,
showCharCount: false,
showWordCount: false,
properties: {},
allowMultipleMasks: false,
tree: false,
theme: "default",
breadcrumb: "default",
id: "eake1do"
}
]
}