To hide column value & to enable hide column value in the link?

QuestionsTo hide column value & to enable hide column value in the link?
Mohamed Akbar asked 8 years ago

Dear Mr Abu,

I want to hide the column value for example column (job_id), but i want to pass that value through the html link

like this $col["link"] = "emp_app_form/print_pdf_job_mail.php?id={job_id}";
$col["linkoptions"] = "target='_blank'";

if i hide this column(job_id) it not showing the proper id through the link

like this emp_app_form/print_pdf_job_mail.php?id=100";

Thank you,

6 Answers
Abu Ghufran answered 8 years ago

You can use alternate of link, that allow html tags.

$col["default"] = "<a href='emp_app_form/print_pdf_job_mail.php?id={job_id}' target='_blank'>Job Link</a>";

It will now show link as Job Link with your required url.

mohamed eltahir answered 8 years ago

Dear Mr Abu,

I can't use above option,bcz i need to access the link through the name using job_id

$col = array();
$col["title"] = "Name";
$col["name"] = "name";
$col["dbname"] = "LOWER(name)";
$col["width"] = "100";
$col["editable"] = false; // this column is not editable
$col["link"] = "emp_app_form/print_pdf_job_mail.php?id=job_id";
$col["linkoptions"] = "target='_blank'"; // extra params with <a> tag
$col["align"] = "left";
$cols[] = $col;

Abu Ghufran answered 8 years ago

Replace Job Link with {name}

$col["default"] = "<a href='emp_app_form/print_pdf_job_mail.php?id={job_id}' target='_blank'>{name}</a>";

mohamed eltahir answered 8 years ago

Dear Mr Abu,

Sorry not working.I replaced your code instead of $col[link].It showing like a normal data not the linked data.I'm not able post the screenshot here.

$col = array();
$col["title"] = "Name";
$col["name"] = "name";
$col["dbname"] = "LOWER(name)";
$col["width"] = "100";
$col["editable"] = false; // this column is not editable
$col["default"] = "<a href='emp_app_form/print_pdf_job_mail.php?id=job_id' target='_blank'>{name}</a>";
$col["align"] = "left";
$cols[] = $col;

Thank you,

Abu Ghufran answered 8 years ago

Looks like you are using free version.
It is only supported in licensed version now.

As alternate, you can replace "default" property with formatter:

$col["formatter"] = "function(cellvalue, options, rowObject){ return '<a target="_blank" href="emp_app_form/print_pdf_job_mail.php?id='+rowObject.job_id+'">'+rowObject.name+'</a>'; }";

mohamed eltahir answered 8 years ago

Dear Mr Abu,

I'm very thankful that you are considering my issues.

Thank you,

Your Answer

20 + 10 =

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?