35
Views
5
Comments
Solved
[OutSystems Data Grid] Action Link Redirecting Incorrectly When Opened in New Tab
outsystems-data-grid
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

Hi,

I am using the Outsystems Data Grid. In the grid, I have an Action column on the list page. When a user clicks the action link, it redirects to the Details page. However, when the user right-clicks in the browser and selects 'Open in new tab,' it shows the same list page instead of the Details page. Can someone please help with this? 

Thanks in advance!

Best regards,

Sathish R

2022-12-30 07-28-09
Navneet Garg
Solution

try following javascript in your Date_GridOnInitialize.

var grid = OutSystems.GridAPI.GridManager.GetActiveGrid();

grid.provider.formatItem.addHandler(function(s,e) {

    if(e.panel === s.cells) {

        var col = s.columns[e.col]

        if(col.binding === 'Name') {

            $(e.cell).find('a').attr("href", "/Sample_Grid/Detail_Screen")

        }

    }


});

you can check here as well

https://personal-u1aragiz.outsystemscloud.com/Sample_Grid/DataGrid_Search?_ts=638756664273417672


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

Hello @Sathish Kumar 

To make this more efficient and collaborative for the community please share a sample OML where that issue can be reproduced. That way someone from the community can take a look without investing more time in implementing the use case.

Cheers,
GM

2022-12-30 07-28-09
Navneet Garg

It seams that your Action column is not working properly. It might be possible that your configuration is wrong or html is not proper.

Can you check your browser console for more detail. Like any javascript error ?

Also if possible please share oml file or screenshot of your implementation so we can help you accordingly. 


2026-02-16 06-54-31
Sathish Kumar

Hi @Gonçalo Martins @Navneet Garg 

I have attached a sample OML.

Thanks,

Sathish R

Sample_Grid_NewTab.oml
2022-12-30 07-28-09
Navneet Garg
Solution

try following javascript in your Date_GridOnInitialize.

var grid = OutSystems.GridAPI.GridManager.GetActiveGrid();

grid.provider.formatItem.addHandler(function(s,e) {

    if(e.panel === s.cells) {

        var col = s.columns[e.col]

        if(col.binding === 'Name') {

            $(e.cell).find('a').attr("href", "/Sample_Grid/Detail_Screen")

        }

    }


});

you can check here as well

https://personal-u1aragiz.outsystemscloud.com/Sample_Grid/DataGrid_Search?_ts=638756664273417672


2022-12-30 07-28-09
Navneet Garg

You can do one more thing

Add a Context Menu with ContextMenu\MenuItem_CustomOption with simple handler included a simple javascript to open link in new tab.

check the solution here

https://personal-u1aragiz.outsystemscloud.com/Sample_Grid/DataGrid_Search?_ts=638756664273417672


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