How to make a dynamic link from a cell value?

QuestionsHow to make a dynamic link from a cell value?
avpman asked 7 years ago

Hi,
I need to link to a php page and pass the cell value as a URL parameter. In the forum I found this answer from Abu:

$col["link"] = "link.php?list1_columname={columname}&c=". $_GET["code"];

But I'm unclear what some of the variables are:
list1_coulumname
{columname} and
"code"

In my application the table field is "idx" the title of the column on the grid is "App Number" and the URL parameter I want to pass is "app=insert value of idx here" to a php page named edit.php. For example, if the cell contained the value 1234 I want the cell to become a link to edit.php?app=1234 when the user clicked the cell.

How do I do that? Thanks in advance for any help. Sorry, still a NOOB here and trying to learn as fast as I can.

4 Answers
Abu Ghufran answered 7 years ago

It works this way:

$col["link"] = "http://google.com/?id={client_id}";

Where client_id is $col["name"] property of grid column.
I guess this feature is part of full version. Please verify.

avpman answered 7 years ago

I have the full version. Your answer worked.
Thank you!

Abu Ghufran answered 7 years ago

along with link set linkoptions:
$col["link"] = "http://google.com/?id={client_id}";
$col["linkoptions"] = "target='_blank'"; // extra params with <a> tag

You can also use persist settings feature. Refer demos/misc/persist-settings.php

selectcas.biz answered 7 years ago

Well, after all this doesn't quite solve the problem. When the use clicks the link it does take them to the intended page. But when they use the back button to get back to the grid, the grid has lost all it's filter settings, column sizing, etc.

a) is there a way to preserve those settings in session variables/cookies?
b) is there a way to open the selected URL in a new window/browser session?

Your Answer

7 + 18 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?