a!localVariables(
local!newgrid: 'type!{urn:com:appian:types:EC}EC_Data'(),
local!grid: { local!newgrid },
a!formLayout(
label: "Practice",
contents: {
a!sectionLayout(
label: "Nitin",
contents: {
a!gridLayout(
label: "Form",
labelPosition: "ABOVE",
headerCells: {
a!gridLayoutHeaderCell(label: "Name"),
a!gridLayoutHeaderCell(label: "Department"),
a!gridLayoutHeaderCell(label: "Document"),
a!gridLayoutHeaderCell(label: "")
},
columnConfigs: {
a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 3),
a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 3),
a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 2),
a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 2)
},
rows: {
{
a!forEach(
items: local!newgrid,
expression: a!gridRowLayout(
contents: {
a!textField(
label: "Name",
labelPosition: "ABOVE",
value: local!newgrid.Name,
saveInto: local!newgrid.Name,
refreshAfter: "UNFOCUS",
required: true,
validations: {}
),
a!multipleDropdownField(
label: "Department",
labelPosition: "ABOVE",
placeholder: "--- Select a Value ---",
choiceLabels: cons!EC_DEPARTMENT,
choiceValues: cons!EC_DEPARTMENT,
value: local!newgrid.Department,
saveInto: local!newgrid.Department,
searchDisplay: "AUTO",
required: true,
validations: {}
),
a!fileUploadField(
label: "Document",
labelPosition: "ABOVE",
target: cons!EC_PHOTOS,
value: local!newgrid.Document,
saveInto: local!newgrid.Document
),
a!richTextDisplayField(
labelPosition: "COLLAPSED",
value: {
a!richTextIcon(
icon: "window-close",
altText: "Delete Row Button",
link: a!dynamicLink(
label: "Dynamic Link",
saveInto: {
a!save(ri!item, remove(ri!item, fv!index))
}
),
color: "#ff0000"
)
}
)
}
)
)
}
},
selectionSaveInto: {},
addRowLink: a!dynamicLink(
label: "Add New Recod",
saveInto: {
a!save(ri!item, append(ri!item, local!newgrid))
}
),
validations: {},
shadeAlternateRows: true
)
}
)
},
buttons: a!buttonLayout(
primaryButtons: {
a!buttonWidget(
label: "Submit",
icon: "check-circle",
value: local!newgrid,
saveInto: { a!save(ri!item, local!newgrid) }
)
}
)
)
)