362
Views
20
Comments
Solved
[OutSystems Data Grid] Link Column in Outsystems datagrid with out action column
outsystems-data-grid
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

Hi

i am using outsystems datagrid reactive component.i am using this with autogenerate option.i cant mention static column and action column.with out action column is it possible to display link against one record so i can open detail page if i click.

2022-08-03 04-32-50
Ravi Punjwani
Solution

I just used a sample app, haven't configured anything different in my OML. Here's the URL to try out

https://personal-t4mpz2cn.outsystemscloud.com/DataGrid_Sample/

  • Let the grid load on this page
  • Open Chrome Dev Console
  • Paste this script:
    let elementId = 'MainGrid';
    let rowIndex = 1;
    OutSystems.GridAPI.Rows.GetRowData(elementId, rowIndex)
2022-08-03 04-32-50
Ravi Punjwani

Hi Arkyadeep,

I don't think this is possible in current feature set of this forge component.

How did it go with your trials on the other component
https://www.outsystems.com/forge/component-overview/13211/data-grid-with-click

I guess you tried that a few days ago, did it end up with some issues?

2023-06-14 08-52-52
Arkyadeep Bharadwaj

I am using auto generate.i don't want to add any column in the grid.

2022-08-03 04-32-50
Ravi Punjwani

Sorry I didn't understand what you mean by auto generate.

Is it the auto-scaffolding of the grid based on entity, like the accelerator? or something else?

2023-06-14 08-52-52
Arkyadeep Bharadwaj

If u did not mention any column in the grid and if u pass the json then it will populate the data based on your json

2022-08-03 04-32-50
Ravi Punjwani

Alright I got it now about your requirements. I don't think it is possible, at least in this component.

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi @Arkyadeep Bharadwaj ,

i made a forge component a couple of days ago to add click event handler to grid.  It gives you row and column that was clicked.  This works also on autogenerated grid.

datagridevent

also, this is on the radar of Outsystems to add as functionality to the datagrid itself, see this idea.

Dorine

2023-06-14 08-52-52
Arkyadeep Bharadwaj

is it possible to generate column with hyperlink without action column.

2021-09-06 15-09-53
Dorine Boudry
 
MVP

it just gives you an event, saying what row and what column was clicked, from there you can decide what consequence you want from that click.  So, yes no action columns are needed, but no, the technology used is not a hyperlink.

Dorine

2022-08-03 04-32-50
Ravi Punjwani

@Dorine Boudry the other one which I suggested also works the same way.
https://www.outsystems.com/forge/component-overview/13211/data-grid-with-click

It fires a click event on the parent grid whenever a cell is clicked, and provides the cell's column and row numbers.

I think both of these components would work in this scenario.

2021-09-06 15-09-53
Dorine Boudry
 
MVP

yeah,

 it's just that the other one is a clone of datagrid component, I think that's a horrible strategy

2023-06-14 08-52-52
Arkyadeep Bharadwaj

If inuse your component then can I get clicked row and colum postion for particular data.if it is possible can u plz share one sample oml file.

I have one datagrid which is autogenerated and if I click firstname colum and row number is suppose 4 then I need row no 4 primary key value based on the click.that value i want to pass to different screen to open details page 

Waiting for your reply




2021-09-06 15-09-53
Dorine Boudry
 
MVP

just look at the demo application as a sample on how to use it.  

Of course it can not give you the primary key of your entity, only the row clicked, both the datagrid and this component are business agnostic, how could it know what your primary key is ?

2022-08-03 04-32-50
Ravi Punjwani

Hi AB,

Have you tried using its API? Example, OutSystems.GridAPI.Rows.GetRowData('OS_MyGridId', 1) in javasript to get the 1st row of the grid 'OS_MyGridId'

It returns JSON value in following format

'{"isSuccess":true,"message":"Success","code":200,"value":"{\\"Tenant_Id\\":0,\\"Id\\":5,\\"Name\\":\\"Ann Olivarria\\",\\"Username\\":\\"ann.olivarria@example.com\\",\\"Password\\":\\"$1$36Fdfsdfasdffsdfsdfsdfsdfsdgsgsdfs30DC514D81494\\",\\"Email\\":\\"ann.olivarria@example.com\\",\\"MobilePhone\\":\\"1-553425-720-9353\\",\\"Creation_Date\\":\\"2022-09-04T18:47:44Z\\",\\"Is_Active\\":true}"}'

2023-06-14 08-52-52
Arkyadeep Bharadwaj

No my question is inhave datagrid and in that grid I am binding the ID but when I click based row and column position can I get particular cell value

2023-06-14 08-52-52
Arkyadeep Bharadwaj

Is it possible to share ur oml file?because after getting row and column value i have to take the Id and that I'd i have to pass to different page to display details data.

2022-08-03 04-32-50
Ravi Punjwani
Solution

I just used a sample app, haven't configured anything different in my OML. Here's the URL to try out

https://personal-t4mpz2cn.outsystemscloud.com/DataGrid_Sample/

  • Let the grid load on this page
  • Open Chrome Dev Console
  • Paste this script:
    let elementId = 'MainGrid';
    let rowIndex = 1;
    OutSystems.GridAPI.Rows.GetRowData(elementId, rowIndex)
2021-09-06 15-09-53
Dorine Boudry
 
MVP

exactly, using getrowdata  will do it (as is also used in my demo app), but extend on this, there is really no need to do that in javascript, it is available as an action from the Datagrid component.

2022-08-03 04-32-50
Ravi Punjwani

Oh yes, you're right. I didn't realize it was available as a Client Action too.

AB, you're going to have same json text from the client action. Makes sense to avoid a custom javascript.

2022-08-03 04-32-50
Ravi Punjwani

Hi AB,

Were you able to resolve your query for having access to the DataRecord row values?

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