Trying to figure how to use deleteMarkedTimespan

Hi,
I have code that use addmarkedTimespan without keeping the return value and I am using the scheduler live_updates. When I receive a onEventDeleted, I would like to call deleteMarkedTimespan with info from the event that just got deleted, but it doesn’t seem to remove the blocked section. Here is a snippet of the code:


 scheduler.addMarkedTimespan({
                            start_date: event.start_date,
                            end_date: event.end_date,
                            css: "time_busy",
                            type: "dhx_time_block",
                            sections: {
                                timeline: [event.employee_id],
                                unit: [event.employee_id] 
                            }
                        });



scheduler.attachEvent("onEventDeleted", function(id, ev){
            scheduler.deleteMarkedTimespan({
                start_date: ev.start_date,
                end_date: ev.end_date,
                css: "time_busy",
                type: "dhx_time_block",
                sections: {
                    timeline: ev.employee_id,
                    unit: ev.employee_id 
                }
            });
});

any help would be appreciate!
thanks

Hi,
the ‘sections’ part of timespan config has different arguments in scheduler.addMarkedTimespan and onEventDeleted. In first one it specifies arrays of sections, in a later - it’s singular values. Probably this is the case

I’ve tried this code on the online example (you can run it in browser console) and it seems adding and removing timespans as expected
docs.dhtmlx.com/scheduler/sample … ation.html

[code]scheduler.setCurrentView(new Date(), “timeline”);
scheduler.addMarkedTimespan({
start_date: new Date(2014, 8, 17, 00), end_date: new Date(2014, 8, 18), type:“dhx_time_block”,
sections: {
timeline: [2,3]
}
});

scheduler.deleteMarkedTimespan({
start_date: new Date(2014, 8, 17, 12), end_date: new Date(2014, 8, 18), type:“dhx_time_block”,
sections: {
timeline: [2,3]
}
});
scheduler.setCurrentView()[/code]