column ["link"] return empty when data loaded not from mysql

Questionscolumn ["link"] return empty when data loaded not from mysql
Igor asked 6 years ago

i loaded data not from mysql:

$response = file_get_contents($url, false,stream_context_create($arrContextOptions));
$g->table = $obj;

$col = array();
$col["title"] = "Testtesttest";
$col["editable"] = false;
$cols[] = $col;

This work perfectly.

But when i try add :
$col["link"] = "{tab_id}";

i have empty value at {tab_id} column.

2 Answers
Abu Ghufran answered 6 years ago

The link property does not work with array based grid, and it's a known limitation.
You can iterate array data via for loop and change value of tab_id to html <a> tag instead of plain id.

Refer demos/loading/load-array.php … it uses hyperlink in grid.

Igor answered 6 years ago

Thank you.
it's worked nice

foreach ($obj as &$ex){
$query_url="; . $ex["tab_id"];
$ex['tab_id'] = "<a class='fancybox' href='" . $query_url . "'>" . $ex['tab_id'] . "</a>";

Your Answer

14 + 5 =

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?