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 1 year 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 11 months 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
PHP Grid Framework
 
Your Answer

9 + 17 =

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:

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

Let us improve this post!