Solved
Delete multiple rows from a grid.
I want to delete one or more rows, but I have to select all the rows and it just deletes only one row.
{
a!gridLayout(
headerCells: {
a!gridLayoutHeaderCell(label: "", align: "CENTER"),
a!gridLayoutHeaderCell(label: "Precio de Colocación", align: "CENTER"),
a!gridLayoutHeaderCell(label: "Número de TÃ%ADtulos", align: "CENTER"),
a!gridLayoutHeaderCell(label: "Importe", align: "CENTER"),
a!gridLayoutHeaderCell(label: "Casa de Bolsa", align: "CENTER"),
a!gridLayoutHeaderCell(label: "Tipo de Registro", align: "CENTER")
},
columnConfigs: {
a!gridLayoutColumnConfig(weight: 1),
a!gridLayoutColumnConfig(weight: 2),
a!gridLayoutColumnConfig(weight: 2),
a!gridLayoutColumnConfig(weight: 2),
a!gridLayoutColumnConfig(weight: 1),
a!gridLayoutColumnConfig(weight: 1)
},
rows: {
a!forEach(
items: ri!colocacion,
expression: {
a!gridRowLayout(
contents: {
a!checkboxFieldByIndex(
choiceLabels: "",
saveInto: fv!item.checkbox,
value: if(fv!item.checkbox, {true}, null),
align: "CENTER"
),
a!floatingPointField(
align: "CENTER",
value: index(fv!item, "precioColocacion", null),
saveInto: fv!item.precioColocacion
),
a!floatingPointField(
align: "CENTER",
value: index(fv!item, "numeroTitulos", null),
saveInto: fv!item.numeroTitulos
),
a!floatingPointField(
align: "CENTER",
value: index(fv!item, "importe", null),
saveInto: fv!item.importe
),
a!dropdownField(
value: index(fv!item, "casaBolsa", null),
saveInto: fv!item.casaBolsa,
choiceLabels: "ACTIN",
choiceValues: "ACTIN",
placeholder: "Seleccione"
),
a!dropdownField(
value: index(fv!item, "tipoRegistro", null),
choiceLabels: "ACTIN",
choiceValues: "ACTIN",
placeholder: "Seleccione",
saveInto: fv!item.tipoRegistro,
)
}
)
}
),
a!gridRowLayout(
showWhen: if(a!isNotNullOrEmpty(ri!colocacion), true, false),
contents: {
a!richTextDisplayField(
),
a!richTextDisplayField(
),
a!richTextDisplayField(
align: "CENTER",
value: if( isnull(index( ri!colocacion, "importe", null)), null, sum(ri!colocacion.numeroTitulos))
),
a!richTextDisplayField(
),
a!richTextDisplayField(
),
a!richTextDisplayField(
),
}
)
}
),
a!buttonArrayLayout(
align: "CENTER",
buttons: {
a!buttonWidget(
label: "Agregar",
submit: true,
saveInto: {
a!save(ri!colocacion, append(ri!colocacion, 'type!{urn:com:appian:types:BMV}BMV_colocacion'()))
},
style: "NORMAL",
),
a!buttonWidget(
label: "Eliminar",
submit: true,
style: "DESTRUCTIVE",
saveInto: a!save(ri!colocacion, remove(ri!colocacion, ri!colocacion.checkbox))
)
}
)
}