Update multiple events at the same time.

Hi,

I want to update two events at the same time in,
scheduler.attachEvent(“onEventChanged”, function(event_id,event_object)
{
scheduler.updateEvent(event_id);
}

This function works only for “event_id” which is been passed. How can i change another event along with this one…??

How can i refresh the Scheduler in the same state without using scheduler.load() method…??
where i have to call that function…??

Regards,
Nikita

Probably I’m missing something, but why not to call

scheduler.updateEvent(event_id1); scheduler.updateEvent(event_id2);

How can i refresh the Scheduler in the same state

scheduler.setCurrentView();

Hi Stanislav ,

I have tried using
scheduler.updateEvent(event_id1);
scheduler.updateEvent(event_id2);
but this doesn’t work in “onEventChanged” event. it will only update “event_id1” but not “event_id2”…!!!

can we stop “onEventChanged” event for some time…??

i want to update both event one after another.


scheduler.setCurrentView(); is not working…
shows error that “this._date is undefined” in dhtmlxscheduler.js at,

line 1973:
…readonly || (!P.drag_move)) ? " dhx_move_denied" : “”);
if (K) {
R.className = “dhx_cal_data” + K
}
this._cols = [];
this._colsS = {
height: 0
};
this._dy_shift = 0;
this.set_sizes();
var I = parseInt(M.style.width);
var C = 0;
var O, Q, A, N;

[b]Q = this.date[this._mode + "_start"](new Date(this._date.valueOf()));[/b]
O = A = this._table_view ? scheduler.date.week_start(Q) : Q;
N = this.date.date_part(new Date());
var D = scheduler.date.add(Q, 1, this._mode);
var E = 7;
if (!this._table_view) {
    var G = this.date...

Regards,
Niki

updateEvent - this method just repaint the event object, is it fails to repaint object or you are expecting some other effect?

As for scheduler.setCurrentView(); - try to use it as

scheduler.setCurrentView(scheduler.getState().date, scheduler.getState().mode);

Hi Stanislav,

I am not able to update event’s date and time.
in “onEventChange” event It only updates the “event_id” which is been passed not the any other event…

e.g. if i say,
scheduler.attachEvent(“onEventChanged”, function(event_id,event_object)
{

event_object.start_date = “date1”;
event_object.end_date = “date2”;
scheduler.updateEvent(event_id);

var MyEventObj = scheduler.getEvent(110);
MyEventObj.start_date = event_object.start_date;
MyEventObj.end_date = event_object.end_date;
scheduler.updateEvent(110);
});

This will update only “event_id” not event with id=110

Regards,
Niki

While code is basically correct and must work, there are two possible issues

a) you need to use date objects not strings

event_object.start_date = new Date(…); //not just a string

b) Sharing the same date object between multiple events is not safe
//MyEventObj.start_date = event_object.start_date; - incorrect

MyEventObj.start_date = new Date(event_object.start_date.valueOf());

Hi Stanislav,

Thank you so much.
it worked…!!

Regards,
Niki