Hi,
I have a gridfield inside a foreach loop. I need to display the items side by side. Currently it is displayed one below the other. I need to display 2 grids in each row.
How to achieve this.
Discussion posts and replies are publicly visible
Hi srinivaasant574373 You can use the columnsLayout, something like this, to display the gridField side by side:
a!columnsLayout( columns: a!forEach( items: local!caseGridDatraForAllUsers, expression: a!columnLayout( contents: { a!cardLayout(contents: { a!richTextDisplayField() }), a!gridField() } ) ) )
Yashwanth Akula Can we make it to have 2 grids in each row. This code displays all the grids in single row
a!localVariables( local!caseGridDatraForAllUsers: enumerate(5), local!numberOfColumns: 2, { a!columnsLayout( columns: a!forEach( items: enumerate(2) + 1, expression: a!localVariables( local!colIndex: fv!index, a!columnLayout( contents: { a!forEach( items: local!caseGridDatraForAllUsers, expression: if( or( mod(fv!index, local!numberOfColumns) = local!colIndex, and( mod(fv!index, local!numberOfColumns) = 0, local!colIndex = local!numberOfColumns ) ), { a!cardLayout(contents: { a!richTextDisplayField() }), a!gridField() }, {} ) ) } ) ) ) ) } )
Refer "CARDS AS A LIST ITEMS" in patterns of the Interface for better understanding