Matt asked 12 months ago

Two questions: Is there a way to force input on the grid edit form to all uppercase?
If I want the default value of a column to be the value of another column in the same table can that be done and how?

5 Answers
Abu Ghufran Staff answered 12 months ago

For 1)
If you want to do on client side:

You can set them using editoptions
$col = array();
$col[“title”] = “Name”; // caption of column

$col[“editoptions”] = array(“onkeyup”=>”this.value=this.value.toUpperCase()”);
$cols[] = $col;

To do this on server side, you can connect on_insert OR on_update event handler and make it strtoupper(). e.g.

$e[“on_insert”] = array(“add_client”, null, true);
function add_client($data)
  $data[“params”][“fullname”] = strtoupper($data[“params”][“fullname”]);
// where fullname is $col[“name”] you want to store in caps.

Abu Ghufran - Dev Team
PHP Grid Framework
Abu Ghufran Staff answered 12 months ago

For 2) Please tell when you need to set default value. Is it on add or edit? if edit, dialog or inline?
Is the field exist in grid from which value need to be read?

Abu Ghufran - Dev Team
PHP Grid Framework
Matt answered 12 months ago

Thanks I’ll try that for my all caps issue.

For the second part I would like to have a default edit value. For example: User_Level would be displayed with the current level of Guest, Registered User, or Admin in the original column and then a second column of New_User_Level would be defaulted to whatever the current user level is set to so the admin could leave it as is or better change it.

Matt answered 11 months ago

Also, this would be for the inline edit.

Abu Ghufran Staff answered 11 months ago

For #2, Demo here: line 51

It loads value of field ‘name’ in ‘gender’ on form load and inline edit.

Abu Ghufran - Dev Team
PHP Grid Framework
Your Answer

18 + 12 =

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 / 5. Vote count:

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

Let us improve this post!