[OutSystems Data Grid] Ability to programmatically/dynamically perform group by
data-grid-reactive
Reactive icon
Forge component by Platform Maintenance
Application Type
Reactive

Does the grid provide any means to perform  a group by programmatically/dynamically without using the drag and drop where we have would predefined groupby that may be driven by a drop down outside the grid and would like to apply it over the grid.

Solution

This can be achieved by using the following client actions from the OutsystemsDataGrid module:

  1. GetViewLayout  
  2. SetViewLayout

Flow snippet :

First step is to get the current grid view state using the 'GetViewLayout', then massage the view state configuration (GetViewLayout.Config -- JSON string) to stuff in the column grouping and apply the new view configuration to the grid by calling the 'SetViewLayout' action.

Note:- The  ColumnName  in here represents the binding  property name of the column to group by and needs to be appended to the groupDescriptions array as an object with an attribute named 'property'.


Hi @Arun Sashayala 

Could you please specify your use case and describe what have you already tried and the difficulties you're having with using the Wijmo APIs or any provided by the component's framework?

Cheers,
GM

In the same line, how would I have the grid render with a row grouping pre applied than the user dragging the column to the group placeholder?

Hi @Fabio Gonçalves Martins 

Based on my exploration I figured out that there is a way with the WiJmo Grid to be able to preset the row group by adding the column to the FlexGrid.provider.collectionView.groupDescriptions, which takes in an object of type "PropertyGroupDescription".

But to apply that in Outsystems the issue would be how to create an instance of the PropertyGroupDescription without explicitly adding references to the wijmo JS files, that would require licensing.


Any idea how to create the instance of the PropertyGroupDescription??


Example for reference :  (line 27-29 of app.js)

https://www.grapecity.com/wijmo/demos/Grid/Grouping/GroupPanelContextMenu/purejs 


Lets talk this thru an example. Lets say we want to build an employee list component to display some basic details of an employee First Name, Last Name.

Now we would like to have other attributes of the employee (age, manager, department...) bound with the data grid but will be hidden. 

We will be providing a dropdown over the grid to with the options such as age, manager, department, when an option is selected, the grid will have to programmatically apply the group by as if the respective column was dragged and dropped.

Solution

This can be achieved by using the following client actions from the OutsystemsDataGrid module:

  1. GetViewLayout  
  2. SetViewLayout

Flow snippet :

First step is to get the current grid view state using the 'GetViewLayout', then massage the view state configuration (GetViewLayout.Config -- JSON string) to stuff in the column grouping and apply the new view configuration to the grid by calling the 'SetViewLayout' action.

Note:- The  ColumnName  in here represents the binding  property name of the column to group by and needs to be appended to the groupDescriptions array as an object with an attribute named 'property'.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.