Blocking the delete action from an occurrence

Hi,

I want to block the delete action for the ocurrence of recurring event from past date.

So I thought to include a condition in “onBeforeEventDelete()” and return false to block the elimination.

scheduler.attachEvent("onBeforeEventDelete", function(event_id, event_object){
          /*
            if (event_object.start_date < new Date()) {                
                    return false;                
            }
            
            return true;
           */

            return false; // all events should not be able to be removed
});

However, the delete is performed in the DB… the dataprocessor inserted an event with rec_type = ‘none’ to delete the ocurrence.

What I can do to block the elimination?

Thanks.

PS: This problem occurs only with the “occurrences”, for the rest of the cases (series, no recurring) onBeforeEventDelete() works well.

Which version of the scheduler you are using?
In case of v4.0 - please update dhtmlxscheduler_recurring.js with the attached one ( fix will be included in the next official version )
dhtmlxscheduler_recurring.zip (6.04 KB)

Thanks for answering!

Currently I use the version 3.7 and have not yet upgraded to the 4.0 because I saw some errors in the console when creating/modifying recurring events in the sample files (samples/03_extensions/01_recurring_events.html) with some browsers as firefox 22.0 and IE 9.

So I will wait for the next stable version (with the fixes) and then update it. :slight_smile:

can you give some details on how can we reproduce these errors?

Sure!

It was in Firefox 22.0 but it also happens in Chrome 27.0 and IE 10.0 with the error Cannot read property ‘!nativeeditor_status’ of undefined



Bug have been confirmed, it happens in all browsers.
You may try latest build, issue should be fixed now
dhtmlxScheduler_130711.zip (852 KB)