Display non select field

QuestionsDisplay non select field
Gary Brett asked 8 years ago

Hi Abu, in the col below I am using a select to have the user choose a status for a case, as you can see I don't allow them to select 'Completed'. This works great except all the cases that have status as completed, the field is blank.

Is there a way to apply this to the editoptions only but have display shoow everything?

$col = array();
$col["title"] = "Status"; // caption of column
$col["name"] = "Status"; // grid column name
$col["dbname"] = "l.Status"; // this is required as we need to search in name field, not id
$col["editable"] = true;
$col["width"] = "30";
$col["editrules"] = array("required"=>true); // and is required
$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 LeadStatus as k, LeadStatus as v from tbl_status Where tbl_status.LeadStatus <> 'Completed'");
$col["editoptions"] = array("value" => ":;".$str);
$col["formatter"] = "select"; // display label, not value
$col["formoptions"] = array("rowpos"=>"7", "colpos"=>"2");
$cols[] = $col;

2 Answers
Abu Ghufran answered 8 years ago

Set following:

$str = $g->get_dropdown_values("select distinct LeadStatus as k, LeadStatus as v from tbl_status");
$col["editoptions"] = array("value" => ":;".$str);
$col["editoptions"]["onload"]["sql"] = "select distinct LeadStatus as k, LeadStatus as v from tbl_status Where tbl_status.LeadStatus <> 'Completed'";

Gary Brett answered 8 years ago

Thanks Abu, that did the trick.

Cheers

Gary

Your Answer

14 + 2 =

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?