lightbox new button ''next event''

Hello,
i created a new button ‘‘Next Event’’ in the lightbox next to the save and delete button that should creat a new event directly so i don t need to go again on the schedgule. The problem is that i am not able to creat a new event do you know how to do it!!!

hi,

scheduler.addEventNow({ start_date: new Date(2013,0,10,8,30), end_date: new Date(2013,0,10,10,30), text: "sample text", }); => This code can be used for direct adding of event

scheduler.addEventNow(); => This will open a light box and

Thank you so much, it helped a lot!

is it possible to take the end time of the first event and put it as the start time of the new event???

hi,
Its possible to do . but tell me which function is used to create the event . please send the code so that i can tell how to do it

i used this function to creat a new event

scheduler.addEventNow();

Hello,

This demo could help you to solve the issue:
docs.dhtmlx.com/scheduler/snippet/b301dd95

i saw your demo,its good but i am not able to solve my problem.

when i use “scheduler.addEventNow();” it will add new lightbox but it will not save the last event, how can i manage it? i want to save all my events

Hi,

please send the how you implemented the code . so that i can help you out of this issue :slight_smile:

Hello, i wrote this!

scheduler.config.buttons_left=[“dhx_save_btn”,“dhx_cancel_btn”,“locate_button”];
scheduler.locale.labels[“locate_button”] = “Next Event”;
scheduler.attachEvent(“onLightboxButton”, function(button_id, node, e){
if(button_id == “locate_button”){
new scheduler.addEventNow();}
});

Hello,
please check this demo:
docs.dhtmlx.com/scheduler/snippet/42a26f39

Basically, what you need to do is:

  1. save the current event
  • there seems to be no public method for saving the lightbox. So you can either invoke click event on the ‘Save’ button of the form, or use an internal method scheduler.save_lightbox();
  1. get the end date from the saved event
  • this one should be clear
  1. invoke creation of new event using the end date of the previous one
  • It can be done using scheduler.addEventNow, as mentioned earlier.

Hi,

var old_event_id; scheduler.attachEvent("onLightboxButton", function(button_id, node, e){ old_event_id = scheduler.getState().lightbox_id; // this will be the event id of the parent lightbox console.log("old"+idnew); if(button_id == "locate_button"){ scheduler.addEventNow(); } });

scheduler.attachEvent("onEventSave",function(id,ev,is_new){ //check weather old_event_id is exist if(old_event_id){ scheduler.addEvent({ start_date: "16-06-2013 09:00", // get old event from time end_date: "16-06-2013 12:00", //get old event to time text: "Meeting", get old event text id: old_event_id }); } });

Try this way . so that both event get saved. please manage the global vaiable old_event_id accordingly .

I hope this will work .