364
Views
11
Comments
Solved
[OutSystems Data Grid] Conditional Format for the data grid Column by other Column
outsystems-data-grid
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

Hi ,

App - Data Grid Reactive.

I want to conditionally show Icon in the cell as like shown below.

But In my condition cell I wanted to show Icon in the cell is Id Column like below

Id                        Status

===================

1                         Pending

2  *                     Active

3  *                     Active

4                         Complete

===================

I wanted to show Icon (Something green circle) in front of Id column values whose Status is Active.

How we can perform this by using data grid. 

In Data grid we have Conditional format but this allows condition on column itself. 

Thanks in advance...



2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

Hi Rohan

I believe this is the same as described in this forum post.

Cheers,
GM

2020-08-05 09-00-16
Gabriel Lundgren

Hey Rohan,


Is your DataGrid editable?

UserImage.jpg
Rohan Hanumante

Hi @Gabriel Lundgren ,

     No it is non editable.

Thanks..

UserImage.jpg
Rohan Hanumante

Hi @Gabriel Lundgren ,

can you provide some working .oml that will be very helpful.

thanks a lot

2024-03-22 09-17-23
Chandra Vikas Sharma
UserImage.jpg
Rohan Hanumante

Hi @CHANDRA VIKAS SHARMA ,

I think that will not help when the condition which I want to put in column is from different column in the grid. 

UserImage.jpg
Rohan Hanumante

Hi @Gabriel Lundgren , @Gonçalo Martins @Ruben Goncalves @AndrĂ© Dinis 

I took the reference from

https://www.outsystems.com/forums/discussion/77223/outsystems-data-grid-how-to-change-color-of-one-cell-depending-on-other-cell-va/?utm_source=community&utm_medium=email&utm_campaign=forum-reply

https://www.outsystems.com/forums/discussion/77208/issue-with-custom-javascript-after-upgrading-to-version-2-6-2/

I used below mentioned code.


But class is not adding to column. I also tried the commented code that's works but select all / checkbox for the row not works in that case. So i Have to use below mentioned code but class is not added to the column. Please, Le me know any solution for this....

GridAPI.GridManager.GetGridById($parameters.GridWidgetId).features.cellStyle.addClass( $parameters.ColumnWidgetId, x.index, 'show-green-indicator', false);

UserImage.jpg
Rohan Hanumante

Sorry code (GridAPI.GridManager.GetGridById($parameters.GridWidgetId).features.cellStyle.addClass( $parameters.ColumnWidgetId, x.index, 'show-green-indicator', false); ) works but the problem when I include data grid in the screen page it works but when I put data grid in web block it doesn't work

Please let me know any solution.

UserImage.jpg
Denis Titkin

Hello @Rohan Hanumante 

You can upload OML with an example in which the code works on the screen page.

Code - (GridAPI.GridManager.GetGridById($parameters.GridWidgetId).features.cellStyle.addClass( $parameters.ColumnWidgetId, x.index, 'show-green-indicator', false); )

2022-12-05 02-29-23
Zureen Camelia Zulkapli

Following post 

2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

Hi Rohan

I believe this is the same as described in this forum post.

Cheers,
GM

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