Disable Delete Icon from LightBox

—>When i am creating an NEW Event i don’t want to display Delete Button on the LightBox
—>At the same time when i am Updating an Existing Event , the Delete Button should Appear on the LightBox .

I think you can do this using the “onLightbox” event (which requires the latest version of dhtmlxScheduler). I’m not sure if this is called when you’re trying to add an event, but it is at least called when you want to edit an event. Something like this code may help you, but won’t directly solve your problem - it basically goes through the DOM, finds all the classes with dhx_btn_set (which will be the buttons in the Lightbox), then keeps or saves the proper ones. The code here only keeps the Close Button

[code]scheduler.attachEvent(“onLightbox”, function(event_id) {

    var items = document.getElementsByTagName("div");
    var results = [];

    for(var i = 0; i < items.length; ++i)
    {
        if(items[i].hasAttribute("class") && items[i].getAttribute("class") == "dhx_btn_set")
        {
            results.push(items[i]);
        }
    }
    
    for(var i = 0; i < results.length; ++i)
    {
        if(results[i].childNodes[1].firstChild.nodeValue == "Close")
        {
            results[i].setAttribute("style", "float: right !important; padding: 5px 15px 0;");
        }
        else //wasn't the Cancel button
        {
            //we just want to remove these nodes
            results[i].parentNode.removeChild(results[i]);
        }
    }
});[/code]

hope this helps. sorry it’s not a direct solution

Hello,

What left after dchang post is only to verify that it is actually a new event.

scheduler.attachEvent("onLightbox", function(event_id) { if(scheduler._new_event) { // custom logic } });

Best regards,
Ilya