search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

AfterRenderJavaScript not working

Asked by Anonymous
10 years ago.
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.
Comment posted by Anonymous
10 years ago.
btw, I am using 4.9 sp3
Comment posted by Anonymous
10 years ago.
The AfterEventRenderJavaScript property is working, but still cannot get AfterRenderJavaScript to work
Comment posted by Dan Letecky
10 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 Anonymous
10 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 Dan Letecky
10 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
10 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).

This question is more than 6 months old and has been closed. Please create a new question if you have anything to add.