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

How to pass javascript for client-side eval from DayPilot event

Asked by Dirk Louwers
17 years ago.
Hi,

I am combining DayPilot with Gaia. I need a way to either pass the viewstate to Gaia during a DayPilot callback, but if this isn't possible I need to pass javascript to the client for evaluation. This javascript should generate a Gaia callback to make an ajax pop-up window visible. Is there a way to do this?

Regards,

Dirk Louwers
Comment posted by Dan Letecky
17 years ago.
You can use DayPilotCalendar.Update(data) method on the server-side to pass a custom parameter (data - a string or a Hashtable) to the client side.

Then specify AfterRenderJavaScript property: It will contain the JavaScript code to be executed after CallBack (in fact it's executed always after the rendering is finished). Your "data" form Update() method will be available as "data" variable. If you pass a Hashtable, it will be evaluated into an object, e.g. data["Result"] will be available as data.Result.

A working example can be found in Demo/Calendar/Default.aspx.
Comment posted by Dirk Louwers
17 years ago.

"You can use DayPilotCalendar.Update(data) method on the server-side to pass a custom parameter (data - a string or a Hashtable) to the client side."

I can just pass my parameters directly into theJS function I will be calling client side. Is it still neccesary to update for theJSto be executed?

"Then specify AfterRenderJavaScript property: It will contain the JavaScript code to be executed after CallBack (in fact it's executed always after the rendering is finished). Your "data" form Update() method will be available as "data" variable. If you pass a Hashtable, it will be evaluated into an object, e.g. data["Result"] will be available as data.Result."

I have triedmyCalendar.AfterRenderJavaScript = "alert('TEST');"; unfortunately this doesn't seem to get executed client side.

"A working example can be found in Demo/Calendar/Default.aspx."

Unfortunately the example mentioned does not demonstrate the use of #AfterRenderJavaScript. Any pointers?

Comment posted by Dan Letecky
16 years ago.
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.