Home Unanswered Active Tags New Question

AfterRenderJavaScript not working

I have placed AfterRenderJavaScript="alert('Test');" in my weekview tag in the aspx file. Yet, when I load the page, I never see the alert box. I can see the "c.afterRender = function(data) {alert('Test');};" in the rendered script in the source, but it does not appear to be called.
Asked by Anonymous 3 years ago.
Replies
btw, I am using 4.9 sp3
Comment posted by Anonymous 3 years ago.
The AfterEventRenderJavaScript property is working, but still cannot get AfterRenderJavaScript to work
Comment posted by Anonymous 3 years ago.
AfterRenderJavaScript is only fired when a callback is finished. It's not fired after the initial rendering.

Because the init code is now moved to window.onload handler, I will need to update it to be fired after the initial rendering as well (so you can run your own code dependent on DayPilotCalendar client-side object from there). It should be changed in DayPilot Pro 5.0.
Comment posted by Dan Letecky 3 years ago.
as a temporary workaround, is there any way, inside the AfterEVENTRenderJavascript, to know when you are on the "last" event to be rendered? Then I could just write the same code I would have for the AfterRenderJavascript?
Comment posted by Anonymous 3 years ago.

I'm afraid it's not so easy. It's much easier to change the code if you have the source available. Just add:

this.afterRender();

at the end of this.Init() in Calendar.js (line 2343).

Comment posted by Dan Letecky 3 years ago.

In DayPilot Pro 5.0 SP1, AfterRender is now fired during the initial rendering as well. You can detect the callback by checking isCallBack variable (for an example, see 5.0 SP1 release notes).

Comment posted by Dan Letecky 3 years ago.
New Reply
This reply is
Your name (optional):

DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java