simple dropdown

Questionssimple dropdown
santosh asked 9 years ago

Hi,

I would like to specify only one field as dropdown without specifying the other fields in the table.

Can I also have a simple example of dropdown involving only one table. Dropdown.php involves two tables invheader and clients

Thanks

1 Answers
Abu Ghufran answered 9 years ago

If you want to customize any specific column properties, and let other columns be displayed from table definition, you can pass 2nd argument of `set_columns($cols,true)` to `true`. e.g.

$col = array();
$col["name"] = "company";
$col["edittype"] = "textarea";
$cols[] = $col;

$g->set_columns($cols,true);

You can make dropdown values based on passed query. It could be from same table.e.g.

$col["edittype"] = "select"; // render as select
$str = $g->get_dropdown_values("select productid as k, productname as v from products");
$col["editoptions"] = array("value"=>$str);

Your Answer

2 + 13 =

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?