Can I save the lightbox without exiting

I want to be able to click save in the lightbox without it returning to the calendar.

That way I can click on a custom button that uses the event id

I can’t force the user to exit and re-enter the screen to press the button.




if you use a custom lightbox your can disable the call of the “scheduler.endLightbox(true, custom_form);” when click on “Save” button. … _form.html

a sample with a custom lightbox: … _form.html

There must be a simple way to intercept the save button so that it doesn’t close the event edit lightbox dialog.

I have a bunch of fields in my lightbox. So creating a custom lightbox is an issue (since I have to write code to save values now…)

It just needs to save and not close.

I don’t mind adding buttons or links if that’s a way to do it.



You can add or change buttons in the lightbox … ttons.html

Ok. I guess I have to figure out which API call will work.



With above linked code, you can set a custom buttons for lightbox instead of default save button. And for custom buttons you can have your own processing logic, which can trigger data saving without closing lightbox. Or, you can just call something like

scheduler.endLightbox(true); scheduler.showLightbox(id);

It will close lightbox, start data saving and reopen the lightbox again.

That should do the trick. Will try that now.

Thanks so much,


When I add your code it freezes. After I refresh I notice that it added the event.

I modified it to get the id, but that doesn’t help either.

I’m wondering what I can do to make it work?



    scheduler.attachEvent("onLightboxButton", function(button_id, node, e){ 
        if(button_id == "save_button"){                                     
            var id = scheduler.getState().select_id;                        

It hangs on the endLightbox?


Do you have any kind of online demo or a sample where problem can be checked ?

The above code looks fine for me. Similar one works correctly locally.

I will see if I can give access to the program.

When I use your code is doesn’t have the ID so it complains.

Once I give it access to the id it complains with the following message


TypeError: f is undefined

…("#")!=-1;d&&(g=a.split("#")[0]);var h=function(a){var b=c.getEvent(a);b._end_da…

dhtmlx…ring.js (line 21)

function(a){return a.toString().indexOf("#")==-1};c.showLightbox_rec=c.showLightbox;c.showLightbox=function(a){var b=this.locale,e=c.config.lightbox_recurring,f=this.getEvent(a),g=f.event_pid,d=a.toString().indexOf("#")!=-1;d&&(g=a.split("#")[0]);var h=function(a){var b=c.getEvent(a);b._end_date=b.end_date;b.end_date=new Date(b.start_date.valueOf()+b.event_length*1E3);return c.showLightbox_rec(a)};if((g||g==0)&&f.rec_type)return h(a);if(!g||g==0||!b.labels.confirm_recurring||e==“instance”||e==“series”&&

Your code didn’t work because ‘id’ wasn’t defined.

I gave it a function to get the id but it returns null after the endLightbox(true)

So then it trips up after that…



     scheduler.attachEvent("onLightboxButton", function(button_id, node, e){  
         if(button_id == "update_button"){                                    
             var id = scheduler.getState().select_id;                         


RE: can’t create a button in the lightbox that saves without ending up on the calendar page (like the default save does). tried the endLightbox but that doesn’t work. and even if so I can’t get the id for the showLightbox


Not sure why endLightbox doesn’t work?

No Javascript errors…


Here are my issues:

  1. the endLightbox saves the record but doesn’t close the default form
<?xml version='1.0' ?>

(14942 is the my event id to the created events record)

  1. the recurring include causes exceptions (remove temporarily)
  2. I’m not able to get the id so I have no parameter for the showLightbox even if the endLightbox worked…

scheduler.attachEvent(“onLightboxButton”, function(button_id, node, e){

  if(button_id == "update_button"){                                     
      scheduler.endLightbox(true); // DOESN'T CLOSE                                      
      scheduler.showLightbox(id); // WHERE CAN I GET THE ID FROM?                             

// all these get null wherever I put them
// var id = scheduler.getState().select_id;
// var ev = scheduler.getEvent(scheduler.getState().lightbox_id);
// scheduler.cancel_lightbox_origin();
// console.log(ev.event_id);

please try this method:

scheduler.config.buttons_left=["dhx_save_btn","dhx_cancel_btn","save_not_close_button"]; scheduler.locale.labels["save_not_close_button"] = "Save not close"; scheduler.attachEvent("onLightboxButton", function(button_id, node, e){ if(button_id == "save_not_close_button"){ var eventId = scheduler.getState().lightbox_id; scheduler.save_lightbox(); scheduler.showLightbox(eventId); } });

Thanks so much, but still pending issues.

If I include the recurring module there’s and error (pls. see below)

I’m not able to close and re-open the lightbox automatically (some of my links are generated with the event id which I’m not able to get after saving yet)

I appreciate your attention.


// cancel button

TypeError: b is undefined


dhtmlx…ring.js (line 20)

for(var j=!1,l=0;l<this._rendered.length;l++)this._rendered[l].getAttribute(“event_id”)==a&&(j=!0);if(!j)this._select_id=null}return!0});c.attachEvent(“onEventAdded”,function(a){if(!this._loading){var b=this.getEvent(a);b.rec_type&&!b.event_length&&this._roll_back_dates(b)}return!0});c.attachEvent(“onEventSave”,function(a,b){var c=this.getEvent(a);if(!c.rec_type&&b.rec_type&&(a+"").indexOf("#")==-1)this._select_id=null;return!0});c.attachEvent(“onEventCreated”,function(a){var b=this.getEvent(a);if(!b.rec_type)b.rec_type=

I think this it’s almost working.

I need a key value that I get from getEvent

Then I can use that value to create a location call

But for some reason I can access some values of the getEvent object and other’s not. Or if I access the id, which is the event_id I’m looking for it gives me the lightbox_id. Or sometimes it has nothing and other times it’s full?

I dumped the value of the object below.

How can I get the ‘id’ value? I have tried, temp[‘id’]…








Date {Wed Apr 09 2014 13:10:00 GMT-0400 (Eastern Standard Time)}


“15019” <<<< I WANT TO GET THIS VALUE???




Date {Wed Apr 09 2014 13:05:00 GMT-0400 (Eastern Standard Time)}

“New event type”


if(button_id == “save_not_close_button”){
var eventId = scheduler.getState().lightbox_id; // works
scheduler.save_lightbox(); //works
scheduler.showLightbox(eventId); // works

  var temp = scheduler.getEvent(eventId);                         
  console.log(temp);     // shows the output above                                         
  console.log(temp['id']);  // shows the lightbox id ???                                      


The other odd behavior is that the newly created record only has a cancel button on it.


when the event is saved it changes its ID, but the lightbox is open for old ID. I think this can’t be solved without changing the private properties (in general it’s not so good…):

scheduler.locale.labels[“save_not_close_button”] = “Save not close”;
scheduler.attachEvent(“onLightboxButton”, function(button_id, node, e){
if(button_id == “save_not_close_button”){
var eventId = scheduler.getState().lightbox_id;

scheduler.attachEvent(“onEventIdChange”, function(old_id,new_id){
if(scheduler._lightbox_id) // if lightbox is open
scheduler._lightbox_id = new_id;

Fantastic!!! Save button working

One more minor issue and then I should be over the hump. After I save I’m not getting the select_id without re-entering the lightbox.

I am trying to create a dynamic link off that value.

Thanks sooo much,



show mode

After saving…

The new_id gives me null?


var link7 = “show id is null”;

return “

” + link7 + “