coloring the event using server side data

Hello everyone,

I am using scheduler in dhtmlx.

So in that I want to set color for each event from database.

Using one table it’s fine(setting color if it is in primary table while joining).
I want to set color of event when color column is in secondary table in table joining.

I am using php and mysqli.

this is my index.php file


How to start html, body{ margin:0px; padding:0px; height:100%; overflow:hidden; }
my row

And this is connector


$mysqli = new mysqli(‘localhost’, ‘root’, ‘’, ‘mycalendar’);
$details = new JSONDataConnector($mysqli, “MySQLi”);
$events = new JSONSchedulerConnector($mysqli, “MySQLi”);
$events->mix(“users”, $details, array(
“id” => “user_id”

Please help!!!


Unfortunately I’m not fully understand what you try to achieve.

Perhaps this way can help you to solve the issue.
You can specify the color as a property of event object. To change this value by the lightbox, you should create a list of options using serverList. So it will be possible to configure the color using the lightbox.

Please see example how it works

figured it out…
in this event that I had, added the code there…

    scheduler.templates.event_class=function(start, end, event){
        event.textColor = "white";
        if(event.rec_type == 'EXPIRY')
            event.color = "red";               
        else if(event.rec_type == 'LEAD_NOTE')
            event.color = "green";
        else if(event.rec_type == 'USER_EVENT')
            event.color = "blue";
        if (event.userId == CurrentUserID)                 
            return "user_" + CurrentUserID;                                 

Hi Sticcino,
please check my reply here.