Creating grid links that work in containers

If you have ever tried to create a field link in a grid that loads another app, you will notice that if you are using that grid inside a container, the link loads the linked app in the container.
This my be fine in some instances, but in other instances you may want to load the linked app on the same page. You will need to use Javascript instead of sc_link()

  1. Create a new text field in the grid: link_field

  2. Grid, onRecord Event:


{link_field} = "<a href="javascript:void(0);" onclick="parent.location='../form_edit/form_edit.php?id={id}'">Edit</a>";

You should now have a link field in the grid (in a container) that will load the edit form in the same page (parent).

Regards,
Scott.

Re: Creating grid links that work in containers

Works fantastic…!
Great Work…!

Regards
Dhana

Re: Creating grid links that work in containers

Hi Scott,

Not seen any posts or replies for a longer time…?..!

I had a requirement where I want to jump to different URL, Not a sc application,
If i changed the direct URL traps error…

Code:
{link_field} = “<a href=“javascript:void(0);” onclick=“parent.location=’…/form_edit/form_edit.php?id={id}’”>Edit</a>”;

any ideas

THanks & Regards
Dhana

Re: Creating grid links that work in containers

If its a page, you can put directly in the href statement

{link_field} = "<a href="http://www.google.com.br">Edit</a>";

What scott did was only an example. You can modify anything that you want.

See more at http://www.htmlquick.com/reference/tags/a.html

Re: Creating grid links that work in containers

Hi Diogo Toscano,
Yes…It is working fine… But now the issue is , I don’t have Option Back button in the window… That is why, i tried blank application for this need…!
Any suggestion.

Regards
Dhana

Re: Creating grid links that work in containers

Back button … from the browser or the applications toolbar?

I didnt understand … if is a url, not a SC applications like you said … where is this back button?

Re: Creating grid links that work in containers

Diogo Toscano,
When the SC Application opens up, it always has a Back button to move back the parent window, The Browser button will only give "Webpage has expired "

Any way, your approach on the linking with image and Blank application would solve this issue…!

I will get back with results

Thanks
Dhana