Add Event

hi ,
i want to catch or get the new event in json format that will be added in schedule using Add Event
to send it directly to server

thanks

Hello,

The events can be saved using DataProcessor:

dhtmlxScheduler_mobile_v35_120626/samples/01_basic/05_data_saving.html

thanks for replay … i make custom add i need to append the json object that already parsed to Schedule whan add save in my new Form …
$$(“scheduler”).parse(data, “json”);

is that possible ?

Hello,

to add the view item into scheduler datastore you need to call add() method:

var data = {…};
$$(“scheduler”).add(data);
$$(“scheduler”).setCursor(data.id);

setCursor method should be used if you want to make the new event active (it will be shown in event view for example)

If you’ve defined save attribute in scheduler config (DataProcessor is enabled), a request will be automatically sent to server-side script. If you, for some reasons, do not want to use DataProcessor, you could use dhx.ajax() method to send request. Please see sample in dhtmlxTouch package (dhtmlx.com/touch/):

dhtmlxTouch_v12_120913/samples/10_server/02_saving/01_form_saving.html
dhtmlxTouch_v12_120913/samples/10_server/02_saving/02_list_saving.html

thank you very much for your quick reply … and sorry for my many questions :slight_smile:
i already make my custom Add , and i want to make readonly = false
so i can delete … but i need delete only without add or Edit
and i intent to use this code for delete to sync with my service … right ?

var eventId = $$("scheduler").getCursor();
$$("scheduler").deleteEvent(eventId);
return eventId ;    // return id to server 

thanks ,

Mobile scheduler does not have deleteEvent(id) method. You should use remove(id) instead

and what about enable only delete mode … very important

thanks,

You can customize toolbars and remove unnecessary buttons:
docs.dhtmlx.com/doku.php?id=dhtm … iew_screen
docs.dhtmlx.com/doku.php?id=dhtm … om_toolbar

Example for toolbar in event view:
scheduler.config.selected_toolbar = [
{view:‘button’, inputWidth:scheduler.xy.icon_back, css:“cancel”, id:“back”,align:“left”,label:scheduler.locale.labels.icon_back}
];