How can I fill fields with given values that I don't want to show in the grid?

QuestionsHow can I fill fields with given values that I don't want to show in the grid?
Rudolf Wagner asked 1 year ago

To put it simple: I have a grid based on a table of time entries. I want to show these entries based on employee ID. The employee can create a new entry but should not input his employee ID. This should happen automatically under the hood via a session variable. Is there way to get this done?

Regards, Rudolf

1 Answers
Abu Ghufran Staff answered 1 year ago

Hello,

Yes, that’s doable using custom events (on_update, on_insert etc). That’s a common scenario where these events are used.

https://www.gridphp.com/docs/grid-events/

For e.g.

$e["on_insert"] = array("add_client", null, true);
$g->set_events($e);

function add_client($data)
{
	$data["params"]["userid"] = $_SESSION["userid"];
}
_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

14 + 4 =

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?