deleteEvent problem

Hi, i have a problem in year_view.

After scheduler.deleteEvent(eventId), lost date in onEmptyClick event. why?

scheduler.attachEvent(“onClick”, function (id, e) {
scheduler.deleteEvent(id);
return true;
});

scheduler.attachEvent(“onEmptyClick”, function (date, e) {

    console.log(date); // show null

    var formatFunc2 = scheduler.date.date_to_str("%Y-%m-%d");
var data2 = formatFunc2(date);

    var aux = x.xmlDoc.responseText.split(";");	

var id_event2 = scheduler.addEvent({
		id : aux[0],
		start_date : data2 + " 00:00:00",
		end_date : data2 + " 23:59:00",
		text : "",
		color : aux[1],
		template : myGrid.getSelectedRowId().substr(0, 2) == 't_' ? '1' : '0'
});

return true;

});

Hello,
I’ve confirmed the issue, seems like onEmptyClick does not provide a date at all in a year view.
We’ll provide you a fix or a workaround in a couple of days

Thank you!

Any solution?

Hello,
seems like deleting records on click somehow interfered with further processing of the event.
Try adding couple of checkings to your code in order to make sure that deleted event won’t break anything, dates seems working correctly after that:
docs.dhtmlx.com/scheduler/snippet/98ae3652

Hello Aliaksandr,

thank you by the solution.

I think my problem was not to make the setCurrentView(); after deleteEvent(id);

I will try the solution and give you a feddback…