Hi folks,
I need to display multiple files stored in a particular folder in a grid on an interface.
Any help will be appreciated. TIA.
Discussion posts and replies are publicly visible
Hi Apoorva,
I have tweaked the above code a bit to accommodate sorting. Please find the code snippet,
load( local!data: { { id: 2, folderId: 10245/* Folder ids*/ } }, local!doc: tointeger( a!forEach( items: index( local!data, "folderId", {} ), expression: folder( fv!item, "documentChildren" ) ) ), local!pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 3, sort: a!sortInfo( field: "dateCreated", ascending: true ) ), local!data2: a!forEach( items: local!doc, expression: { id: fv!item, doc: document( fv!item, "name" ), uploadedBy: document( fv!item, "lastUserToModify" ), dateCreated: document( fv!item, "dateCreated" ) } ), with( local!currentData: todatasubset( local!data2, local!pagingInfo ), a!gridField( label: "", labelPosition: "ABOVE", totalCount: local!currentData.totalCount, columns: { a!gridTextColumn( label: "Document", data: index( local!currentData.data, "doc", {} ), field: "doc", links: a!forEach( items: local!currentData.data, expression: a!documentDownloadLink( document: fv!item.id ) ) ), a!gridTextColumn( label: "Uploaded By", field: "uploadedBy", data: index( local!currentData.data, "uploadedBy", {} ) ), a!gridTextColumn( label: "Date Created", field: "dateCreated", data: index( local!currentData.data, "dateCreated", {} ) ) }, saveInto: local!pagingInfo, value: local!pagingInfo ) ) )
I have created a dictionary with all the fields required and then using todatasubset() function, have converted the same into a datasubset. I have used the final datasubset to display data in the grid.
Hope this helps!
Thanks,
Hema
Does anyone know how to filter information in the grid where I extract the documents, for example filter only two documents with the name PDF, XLS.