How to call a php function using col link

QuestionsHow to call a php function using col link
c3media asked 4 years ago

Hello,

 

I would like to cal a php function using this method:

$col = array();
$col[“title”] = “Gender”;
$col[“name”] = “gender”;
$col[“width”] = “100”;
$col[“search”] = true;
$col[“editable”] = true;
$col[“export”] = false; // this column will not be exported
$col[“link”] = “http://localhost/?id={gender}”; // e.g. http://domain.com?id={id} given that, there is a column with $col[“name”] = “id” exist
$col[“linkoptions”] = “target=’_blank'”; // extra params with <a> tag
$cols[] = $col;

The parameter {gender}, will be received by the function to execute MySQL Query

 

Regards!

2 Answers
Abu Ghufran Staff answered 4 years ago

Hi,

For this you can call a JS function on click. Inside JS you need to call ajax to some URL which transfers control to php where you can execute your php code.

You need to write custom code as it is not supported by library itself.

Ref: Get Next ID to autofill Add form, See line 25,35,63 – https://www.gridphp.com (github.com)

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
c3media answered 4 years ago

Thank you sir,

 

Was Solved using Ajax JS function

Your Answer

1 + 0 =

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?