Save an event to mysql with extra data.

Hello, i’m a newbie that’s why i’m bothering you guys.

I created a select field in the lightbox wich retrieves the list of employees from mysql. Let’s say, the employee who created that event. I also created a tab (units view) called “Employees”. When I create an event, for example in day view, it works fine, i can choose employee XXXX and then I can see that event exactly on XXXX’s column in units view (Employees tab).

How can i save “that specific event related to employee XXXX” to mysql? Because when I refresh the page the event is gone in unit events. So the next time I open the scheduler the events do not disappear in unit view.

I don’t know if this is easy to implement but I’m confused about how scheduler works exactly.

Best regards,

Just add the name of custom field to the list of connector’s fields ( and add it to the table in DB of course)

In php

scheduler.render_table(“events”,“id”,“start_date,end_date,text,myproperty”);

In js code ( configuration of lightbox )

{name:“mysection”, height:32, type:“select”, map_to:“myproperty”} ]

Thank you very much Stanislav!!! :=)

Can I use the same solution with render_sql?
I’m trying but its not working…

Render SQL is good for data fetching but may not work for data saving ( if you are joining multiple tables - it will not work for sure )

Client side will send new values to the server but you will need to add your custom saving handlers
Check

docs.dhtmlx.com/doku.php?id=dhtm … ex_updates

I’m not so sure but, is this what is to be done?

[code]$scheduler->render_sql(“select active_id,active_date,active_date_end,active_desc from sd_Activities where user_id=7”,“active_id”,“active_date,active_date_end,active_desc”);

$scheduler->sql->attach(“Insert”,“Insert into sd_Activities(contact_id, active_date, active_desc, active_date_end) Values ({contact_id}, ‘{active_date}’, ‘{active_desc}’, ‘{active_date_end}’)”);
$scheduler->render_sql(“Insert”,“active_id”,“contact_id,active_date,active_desc,active_date_end”);[/code]

It can be used as

[code]$scheduler->sql->attach(“Insert”,“Insert into sd_Activities(contact_id, active_date, active_desc, active_date_end) Values (’{contact_id}’, ‘{active_date}’, ‘{active_desc}’, ‘{active_date_end}’)”);

$scheduler->render_sql(“select active_id,active_date,active_date_end,active_desc from sd_Activities where user_id=7”,“active_id”,“active_date,active_date_end,active_desc”);[/code]

a) attach before render_sql
b) you are using contact_id in insert, but not using it in select, as result you will not have any actual info during saving

Thank you!!