Hi,
I found a code that explain how to display files in a grid, but my problem is that I can't create new columns with more information, for example the Description of the file. Please, can you give an advice?
This is my currect code. Thanks a lot.
load( local!data: { { id: 1, folderId: 4768/* Folder ids*/ }, { id: 2, folderId: 4947/* Folder ids*/ } }, a!gridLayout( label: "Documentación", labelPosition: "ABOVE", headerCells: { a!gridLayoutHeaderCell( label: "Nombre documento" ) }, columnConfigs: {}, rows: { a!forEach( items: local!data, expression: a!gridRowLayout( id: fv!index, contents: a!richTextDisplayField( value: a!forEach( items: folder( index( fv!item, "folderId", {} ), "documentChildren" ),/*Getting documents from folder*/ expression: { a!richTextItem( text: document( fv!item, "name" ), link: a!documentDownloadLink( document: fv!item ) ), a!richTextItem( text: char(10), showWhen: not( fv!isLast ) ) } ) ) ) ) }, selectionSaveInto: {}, validations: {}, shadeAlternateRows: true ) )
Discussion posts and replies are publicly visible
Just add more fields to the contents parameter of your gridRowLayout() like you would do with any other grid.
And next time, please ...
Hi José Manuel Ojeda
As you are displaying data in grid, you can add new columns and you can map the document description for each doc.
José Manuel Ojeda said:but my problem is that I can't create new columns with more information
Can you please elaborate.
You can use document() where it can show the Description of the Document, that you can display in the required column.
Thanks! I change it
The problem here is that you will need to again query all the documents in other column and then use document() function on it. You don't have those documents as part of your data subset. So either you add it in your data or you query the folder again to get a list of documents.
When I write a new a!gridLayoutHeaderCell and I map a!richTextDisplayField inside the content of my a!gridRowLayout I recieve this error:
load( local!data: { { id: 1, folderId: 4768/* Folder ids*/ }, { id: 2, folderId: 4947/* Folder ids*/ } }, a!gridLayout( label: "Documents", labelPosition: "ABOVE", headerCells: { a!gridLayoutHeaderCell( label: "Name" ), a!gridLayoutHeaderCell( label: "Description" ) }, columnConfigs: {}, rows: { a!forEach( items: local!data, expression: a!gridRowLayout( id: fv!index, contents: a!richTextDisplayField( value: a!forEach( items: folder( index( fv!item, "folderId", {} ), "documentChildren" ),/*Getting documents from folder*/ expression: { a!richTextItem( text: document( fv!item, "name" ), link: a!documentDownloadLink( document: fv!item ) ), a!richTextItem( text: char(10), showWhen: not( fv!isLast ) ) } ) ), a!richTextDisplayField( value: a!forEach( items: folder( index( fv!item, "folderId", {} ), "documentChildren" ),/*Getting documents from folder*/ expression: { a!richTextItem( text: document( fv!item, "description" ) ), a!richTextItem( text: char(10), showWhen: not( fv!isLast ) ) } ) ) ) ) }, selectionSaveInto: {}, validations: {}, shadeAlternateRows: true ) )
This is my code with the Description column and I recieve an error message:
It's because you are not passing gridRowLayout contents in an array
I don't think you would need another forEach in your line 92 if I am right. because you are already doing it for the gridRowLayout. But are you trying to show multiple details in a single row?