The row data and column data we are getting from backend api so the columns are dynamic in UI . So when we need to group the rows based on api response by writing js code in OUtsystems by pacing Datagrid.ID
Can anyone help me out by sharing the code snippet to group the rows by using provider var provider = GridAPI.GridManager.GetGridById($parameters.gridId).provider or any way dynamically
Hi,I think this sample can help you to better understand DataGrid widget and it contains sampleshttps://www.outsystems.com/forge/component-overview/9765/outsystems-data-grid-sampleKind regardsSirajeddine
I Looked into it , but couldn't find grouping rows sample in the above forge component . And has columns are also dynamic , we need to try in javascript way to group the rows.And I tried using this code snippet by using GetViewLayout and SetViewLayout as per below image attached but right now all the rows are getting grouped to single group,but i need to group the. rows equally with n number of groups in data grid
Hello Nithin,
Please find below images for reference:
I tried going the same , didn't work . I am getting sub group rows one inside the other .Could you please share the oml/oap file please ,it will be very helpful in getting all the contexts on groupCols.
Hi,
I cannot share the OML, Even the screenshots are not possible, hence the images. However, if you debug the action through console, you will get the solution.
Okay , can you please tell me what is groupCols ? is it List of column headers ? Even after making the changes same like the above solution , but ui looks like my screenshot.Bcoz i am not trying to group columns here ,i am trying to group rows like below Figma design screenshot
And if you mind sharing the image of the how grid looks like in UI ?
Yes. groupCols is list of column headers. Groupby doesn't apply with the column header. Suppose If I have "Status" as a column, then it will group by records in "Active" and "Closed". It looks similar to your screenshot.
I tried grouping the rows based on the above instructions, but still it didn't work
Can you provide snaps of your action flow? You need to pass Grouping column's name as a input. And use that input inside 'groupCols' to group by data according to the column name provided
It worked thanks