insert multiple events fom lightbox to DB

Hi all, there is the possibility of insert a multiple events with lightbox?
When I double click on scheduler and lightbox is open i want the possibility of insert for example my custom lightbox:

scheduler.locale.labels.section_trattamentiA=“Trattamento A”;
scheduler.locale.labels.section_trattamentiB=“Trattamento B”;
scheduler.locale.labels.section_trattamentiC=“Trattamento C”;
scheduler.locale.labels.section_trattamentiD=“Trattamento D”;
scheduler.locale.labels.section_trattamentiE=“Trattamento E”;

scheduler.config.lightbox.sections=[

{name:“trattamentiA”, height:21, map_to:“trattamenti”, type:“select”,
options:scheduler.serverList(“trattamenti”)},
{name:“timeA”, height:72, type:“time”, map_to:“auto”}

{name:“trattamentiB”, height:21, map_to:“trattamenti”, type:“select”,
options:scheduler.serverList(“trattamenti”)},
{name:“timeB”, height:72, type:“time”, map_to:“auto”}

{name:“trattamentiC”, height:21, map_to:“trattamenti”, type:“select”,
options:scheduler.serverList(“trattamenti”)},
{name:“timeC”, height:72, type:“time”, map_to:“auto”}

{name:“trattamentiD”, height:21, map_to:“trattamenti”, type:“select”,
options:scheduler.serverList(“trattamenti”)},
{name:“timeD”, height:72, type:“time”, map_to:“auto”}

{name:“trattamentiE”, height:21, map_to:“trattamenti”, type:“select”,
options:scheduler.serverList(“trattamenti”)},
{name:“timeE”, height:72, type:“time”, map_to:“auto”}
]

I want insert in my table events the five new records when i save.

Thank you in advance.

It can be done automatically. But you can use 5 different vars

map_to:“trattamenti0”
map_to:“trattamenti1”
map_to:“trattamenti2”
map_to:“trattamenti3”
map_to:“trattamenti4”

and on server side - define beforeProcessing handler, from which execute any necessary SQL command against the DB.

Hi Stanislav, I have a question:

this is my scheduler_connector.php:

$scheduler->event->attach(“beforeInsert”,myUpdate);
function myUpdate($action){
mysql_query("INSERT INTO clients (name,lastname,alias,phone) VALUES (’{$action->get_value(‘name’)}’,’{$action->get_value(‘lastname’)}’,’{$action->get_value(‘alias’)}’, ‘{$action->get_value(‘phone’)}’) ");
$action->success();
} $scheduler->render_table(“events”,“event_id”,“start_date,end_date,event_name,name,lastname,alias,phone”);

This insert in table clients and not in table events.
The beforeUpdate, beforeInsert etc. bypass the default insertion?
If yes how can insert my data from lightbox in 2 or 3 different tables?

Thank you very much.
Sondra

If you want the default logic to be triggered as well, just remove the next line

$action->success();

In you existing code, it says that insert operation is done, so default logic is not triggered.

Or you can use afterInsert instead of beforeInsert

With this method i can insert 5 new different events with different id ?

Nope it can save 5 fields for one event
If you need to save multiple events from single operations - client or server side code need to be customized. By default component not able to do such action.

Thank you very much Stanislav.

Sondra