0

I would like to have only events displayed from the currently logged in user.

How can I achieve this? I have already configured the event to have a user field.

I am using the JSONSchedulerconnector to populate the DHTMLX-Scheduler.

$connector = new JSONSchedulerConnector(null, "PHPYii");
$connector->set_options("subsubprojects", $subsublist);
$connector->set_options("subprojects", $sublist);
$connector->set_options("projects", $list);
$connector->configure(new Booking(),"id", "start, end, activity, user, project, subproject, subsubproject, status, comment");
$connector->render();

UPDATE: I have tried the filter method, as documented here: https://docs.dhtmlx.com/connector__php__filtration.html#filtermethod

I have inserted before render:

$connector->filter("user", "2");

But it does not work...

ps202
  • 95
  • 2
  • 11
  • Unfortunately, it is not obvious why filter("user", "2") doesn't work for you on the server-side without a demo. I suggest you use filtering method on the client-side (that described on this page https://docs.dhtmlx.com/scheduler/filtering.html), it will be easier. You just need to check the logged user and render events according to the "user" value in data. – Polina Aug 26 '19 at 13:15
  • Thanks Polina, that is what I did (as a workaround). Obviously it is not nice to have all data and just "hide" the unnecessary ones, but this is how it seems to be working right now. I hope that I can solve that somehow on the server-side though... – ps202 Aug 26 '19 at 13:39

0 Answers0