Custom Add Records

QuestionsCustom Add Records
Xavier Ekka asked 10 years ago

How I can Add Records to a table which picks data from one other table.

For example there are two tables, emp_table and salary_table.
When i add a new record in salary_table the pop_up FORM should have a combo box listing all the employee from the emp_table.

1 Answers
Abu Ghufran answered 10 years ago

Please refer the demos/appearence/dropdown.php
It lookup client name from clients table.

$col = array();
$col["name"] = "client_id";

$col["edittype"] = "select"; // render as select

# fetch data from database, with alias k for key, v for value
$str = $g->get_dropdown_values("select distinct client_id as k, name as v from clients");

$col["editoptions"] = array("value"=>":;".$str);
$col["formatter"] = "select"; // display label, not value

$cols[] = $col;

Your Answer

5 + 17 =

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?