sending email after scheduler's treatment

Hi there,

   At the moment, my scheduler sends a notification email every time an event was added/modified/deleted. I placed the call to the php mail function on the afterProcessing event server-side. This works perfectly with one little drawback... the call to the mail function slows down the scheduler's refresh time (from almost instantaneous to about 2-3 seconds delay). This is nothing exactly critical, but of course, users being users, if the wait is too long, they think the application froze and actually try to delete the event while it's saving itself or just plain try to recreate it while it's in the process of saving itself... which, as you can imagine, causes all sort of weird glitches here and there.

So anyway, to fix that, I thought I’d move the call to the mail function to a client-side event that occurs after an operation was made via the use of an AJAX query to a custom PHP script of mine. So, with that thought in mind, I went in search of events that would fit my need and here’s what I came up with:

For INSERT operations: onEventIdChange
For UPDATE operations: onEventChanged
For DELETE operations: onBeforeEventDelete

I was simply curious if there was an event available that would fit all three operations at once? Otherwise these three will do perfectly.

Thanks in advance,

Osu

Instead of scheduler’s event, you can use one of dataprocessor’s

dp.attachEvent("onAfterUpdate", function(sid, action, tid, tag){ ... }

docs.dhtmlx.com/doku.php?id=dhtm … fterupdate

Oh, that’s right I didn’t think of that, thanks a lot :slight_smile:.

Currently, when I need a dataprocessor object, I do:

var dp = new dataprocessor()

Which is, of course, placed in a function meaning that dp is a local variable that’s destroyed at the end of said function. However, when I place a line like this in, say, the init() function:

dp.attachEvent()

How does the dataprocessor remembers an event handler was added to it since the object dp was destroyed at the end of the init() function where the attachment was made?

Anyway, this question is just me being curious, it doesn’t really matter whether you answer it or not :wink:.

Thanks for answering my real question though :slight_smile:.

Osu

The object is not really destroyed.
You just lost access to it, becase variable was a local one, but while there is a reference to the object - it will exists ( and scheduler code creates few such private references during dp.init call )

Ah I see, thanks a lot :slight_smile: