Custom Save function

I want to use a custom javascript function in place of the current save function to update an external master calendar when adding a new event(and in turn the current calendar by parsing the master calendar data within the function), so I have the following questions…

  1. Can I remove the current save function and replace it with my own if so, how?
  2. How do I access the four default fields that are on the add event page? (event, start, end, notes)

Can I remove the current save function and replace it with my own if so, how?

There is not a public method to use custom save function.What should the new save function do (possibly we could provide a solution)?

How do I access the four default fields that are on the add event page? (event, start, end, notes)

You can define new_event_data template that returns default data for form. There default is as follows:

scheduler.template = new_event_data: function(){ var hours = (dhx.Date.add(new Date(),1,"hour")).getHours(); var start = dhx.Date.copy(this.coreData.getValue()); start.setHours(hours); var end = dhx.Date.add(start,1,"hour"); return {start_date:start,end_date:end}; };

There is not a public method to use custom save function.What should the new save function do (possibly we could provide a solution)?

I need it to save back to a SharePoint calendar which is the data source for the mobile calendar. Can I change the behavior at all for the “plus” button? For instance, just make the click event on the plus button point to a different web page where I can have my own new event form that will get me around the not being able to change the save method.

Just to correct above - there is no way to override save function on client side. On server side you can intercept save call and use any custom logic instead of the default one.

As for custom “+” action - you can redefine bottom toolbar

scheduler.config.bottom_toolbar = [
 			{ view:"button",id:"today",label:labels.icon_today,inputWidth:scheduler.xy.icon_today, align:"left",width:scheduler.xy.icon_today+6},
 			{ view:"segmented", id:"buttons",selected:"list",align:"center",multiview:true, options:[
				{value:"list", label:labels.list_tab,width:scheduler.xy.list_tab},
				{value:"day", label:labels.day_tab,width:scheduler.xy.day_tab},
    			{value:"month", label:labels.month_tab,width:scheduler.xy.month_tab}
			]},
			{ view:"button",css:"add",id:"custom_add", align:"right",label:" + ",inputWidth:42,width:50, click:function(){ customAdd(); }},
			{ view:"label", label:"",inputWidth:42,width:50, batch:"readonly"}
		];

While it looks as a lot of code - there is only two differences from default toolbar
a) id of add button changed, so it will not be recognized as add button anymore
b) custom click handler added to add button, just define customAdd function on the page and it will be triggered on button clicking.

Thank you for this solution!! This works perfectly for what I need to do. I see that I can do the same thing with the “Edit” button on the event preview screen using “scheduler.config.form_toolbar”. One more question though…

I don’t see any documentation on how I can do the same thing (override the click event) on the Delete button that is on the event preview screen. Is there another config option to do that?

Or is there just a way to remove the delete button from the event preview screen all together?

Or is there just a way to remove the delete button

Try to use the next after scheduler initialization

scheduler.$$(“delete”).hide();

Awesome, thank you!!