23
Views
4
Comments
Solved
[Data Grid Web] Passing Value to Data Grid
Forge component by OutSystems R&D
41
Published on 14 Dec 2020

Hi Everyone,

I have a case where I need to pass a value from a set of radio buttons to the grid to highlight the corresponding columns. I have looked through the demo as well as the JavaScript and I was wondering what is the best way to do this. I have been able to use an expression with escape content off to set the variable in JavaScript then use the colorRenderer to set the color for that column but I cant seem to figure out how to get the variable to refresh in the JavaScript. I have also tried to use the RunJavaScript function but I have the same result. I am pretty experienced in outsystems but not as much is Java so any help is appreciated. 

If any more explanation is needed please let me know!

Thanks!

Bryan 

Rank: #388
Solution

Hi,

I found a solution. Kindly look into that, hope it helps.

Reference - https://sourav-566913.outsystemscloud.com/DataGridSample/Home.aspx?_ts=637379668149877981

Click on the "Change Cell Color" link on the page and it will change the color of cell "Part No."


Add one custom css class in your page - 


I added one link in the page "Change Cell Color". Onclick event I called a javascript to change the cell color.

This is the function I added in the page javascript. Then I am calling the function to the link OnClick. Here I am passing the cellindex.




Check and let me know if it is your requirement.


Thanks

Sourav


Rank: #388

Bryan Minton wrote:

Hi Everyone,

I have a case where I need to pass a value from a set of radio buttons to the grid to highlight the corresponding columns. I have looked through the demo as well as the JavaScript and I was wondering what is the best way to do this. I have been able to use an expression with escape content off to set the variable in JavaScript then use the colorRenderer to set the color for that column but I cant seem to figure out how to get the variable to refresh in the JavaScript. I have also tried to use the RunJavaScript function but I have the same result. I am pretty experienced in outsystems but not as much is Java so any help is appreciated. 

If any more explanation is needed please let me know!

Thanks!

Bryan 

 

 Hi,

Can you please send some screenshots of your page so that it will be visualised.

Rank: #3202

Here you are, I want to highlight and enter column when the corresponding radio button is pressed 

Rank: #388
Solution

Hi,

I found a solution. Kindly look into that, hope it helps.

Reference - https://sourav-566913.outsystemscloud.com/DataGridSample/Home.aspx?_ts=637379668149877981

Click on the "Change Cell Color" link on the page and it will change the color of cell "Part No."


Add one custom css class in your page - 


I added one link in the page "Change Cell Color". Onclick event I called a javascript to change the cell color.

This is the function I added in the page javascript. Then I am calling the function to the link OnClick. Here I am passing the cellindex.




Check and let me know if it is your requirement.


Thanks

Sourav


Rank: #3202

Yes with some slight modification to fit my particular use case this worked!! Thank you