show original data when field value is not in the edit options values mapping

Questionsshow original data when field value is not in the edit options values mapping
Chengbin Zhu asked 6 years ago

I want the table still rendering the original data if the value is not in the edition options list. Anyway we can achieve it? Current output is empty if there is field’s value not defined in the valid_input table as bellow.

$col = array();
$col[“name”] = “yyy”;
$col[“title”] = “YYY”;
$str = $g->get_dropdown_values(“select distinct valid_input as k, valid_show as v from option_table where table_name=’xxx’ and column_name=’yyy’ order by 1”);
$col[“stype”] = “select”;
$col[“edittype”] = “select”;
$col[“editoptions”] = array(“value”=>$str);
$col[“searchoptions”] = array(“value” => $str, “separator” => “:”, “delimiter” => “;”);
$col[“searchoptions”][“sopt”] = array(“bw”);
$col[“formatter”] = “select”;
$cols[] = $col;

1 Answers
Abu Ghufran Staff answered 6 years ago

Hi,

Apologies for the delay. Ticket somehow get missed.

To show all values, you must remove conditions from query:

$str = $g->get_dropdown_values(“select distinct valid_input as k, valid_show as v from option_table”);
$col[“stype”] = “select”;
$col[“edittype”] = “select”;
$col[“editoptions”] = array(“value”=>$str);

But to have filtered values in edit dialog, you need to set:

$col[“editoptions”][“onload”][“sql”] = “select distinct valid_input as k, valid_show as v from option_table where table_name=’xxx’ and column_name=’yyy’ order by 1”;

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

18 + 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?