Appian Community and Appian Academy are being upgraded. As a part of the upgrade, Appian Community is currently in read-only mode, and user registration is disabled until August 3. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!
The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.
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ítulos", 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)) ) } ) }
Discussion posts and replies are publicly visible
I have made some changes in your code. Let me know if this is what you wanted.
a!localVariables( local!selection, { a!gridLayout( headerCells: { a!gridLayoutHeaderCell( label: "Precio de Colocación", align: "CENTER" ), a!gridLayoutHeaderCell( label: "Número de Títulos", 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: 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( id: fv!index, contents: { 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( selectionDisabled: true, id: 9999, showWhen: if( a!isNotNullOrEmpty(ri!colocacion), true, false ), contents: { 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(), } ) }, selectable: true, selectionValue: local!selection, selectionSaveInto: local!selection ), a!buttonArrayLayout( align: "CENTER", buttons: { a!buttonWidget( label: "Agregar", submit: true, saveInto: { a!save( ri!colocacion, append(ri!colocacion, null) ) }, style: "NORMAL", ), a!buttonWidget( label: "Eliminar", submit: true, style: "DESTRUCTIVE", saveInto: a!save( ri!colocacion, remove(ri!colocacion, local!selection) ) ) } ) } )
It works, thank you