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 5 years 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 5 years 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
Grid 4 PHP Framework
 
Tony Wolsey answered 5 years ago

Thanks Abu. I will try your solution.

 

 

thanks

Tony

Your Answer

3 + 20 =

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?