MySQL fields with Foreign Keys already defined in backend. Can the drop downs from these fields be represnted automatically?

QuestionsMySQL fields with Foreign Keys already defined in backend. Can the drop downs from these fields be represnted automatically?
Tony Wolsey asked 3 months ago

Hello

I have MySQL tables that have several foreign keys already defined. Is there a way to display/recognize these back end drop down fields in the front-end grid easily and automatically without having to create/define them in the PHP front-end file as you have done in the dropdown.php file.  Or is that the only way?

thanks

Tony

2 Answers
Abu Ghufran Staff answered 2 months ago

I’ve reviewed your requirement and easy way could be like in demos/promo/index.php demo:

$col = array();
$col[“title”] = “Company Name”;
$col[“name”] = “company_name”;
$col[“width”] = “50”;
$col[“editable”] = false;
$col[“search”] = true;
$col[“edittype”] = “lookup”;
$col[“editoptions”] = array(“table”=>”suppliers”, “id”=>”company_name”, “label”=>”company_name”);
$cols[] = $col;

_________________________
Abu Ghufran - Dev Team
PHP Grid Framework
 
Tony Wolsey answered 2 months ago

Thanks Abu. I will try your solution.

 

 

thanks

Tony

Your Answer

6 + 0 =

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 / 5. Vote count:

As you found this post useful...

Follow us on social media!

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

Let us improve this post!