Hi
I have my complete custom Lightbox I am calling from controller. It’s working fine. I can save,cancel and delete the data.
But I have an requirement when I click the Save button in the custom lightbox i need to show animation (like rotator) in the lightbox while saving data.
1.How to display animation in the lightbox
2. And if any error I don’t want to close my custom lighbox I just want to show some popup error message in the lightbox only.
I means if successfully saved only it should close my lightbox.
We are using MVC 4 application. If any example please provide it really helping us.
Thank.
Hello,
1)unfortunately current version of the component do not provide an easy way to loader animation.
The possible solution would be to attach onsubmit event handler to a form element inside the custom lightbox iframe, and onload handler to an iframe itself and show loading animation in between these events.
You can check client-side ‘onLightbox’ event, to trace the moment when lightbox is activated
docs.dhtmlx.com/scheduler/api__s … event.html
This seems to be useful functionality, we’ll try to add it to the nearest update. Although I can’t say exact date when it will happen
- There is no way to prevent closing the details form. But, you can trace ‘onAfterUpdate’ event of the dataprocessor(client-side component that responsible for server-side interaction) and reopen lightbox after closing if operation was unsuccessfull:
[code](function(){
var restoreLightbox = false;
scheduler.dataProcessor.attachEvent(“onAfterUpdate”, function(event_id, action, new_event_id, responce_obj){
if(action == “error”){//need to return ‘Error’ action type from the server
restoreLightbox = event_id;
}
});
scheduler.attachEvent("onAfterLightbox", function(){
if(restoreLightbox){
scheduler.showLightbox(restoreLightbox);
restoreLightbox = false;
}
});
})();[/code]