Home Unanswered Active Tags New Question

Open a new window using window.open

I use contextmenu to print a report.

I test the command of DayPilotScheduler1_EventMenuClick which is "print"

I want to open a new form and i use (which works with other page in vb.net)

"<script language=" + Chr(34) + "javascript" + Chr(34) + ">window.open('" + sUrl + "','" + sW + "');</script>"

nothings displays, no window opens.

Have you a solution ?

Asked by Anonymous 1 year ago.
Replies

You could try something like this:

<DayPilot:MenuItem Text="Open" Action="JavaScript" JavaScript="window.open('Details.aspx?id={0}', 'windowname')" ></DayPilot:MenuItem>

Where {0} will be replaced by the event id.

Or:

<DayPilot:MenuItem Text="Open" Action="JavaScript" JavaScript="window.open('Details.aspx?id=' + e.value(), 'windowname')" ></DayPilot:MenuItem>

Where e holds the client-side DayPilot.Event object.

Comment posted by Dan Letecky 1 year ago.

I can't use this because when i go to the print command i make a lot of things and after i must open a new window witch contain the report ...

Comment posted by Anonymous 1 year ago.

Then, if you are using CallBack for invoking EventMenuClick, you can pass custom instructions using Update() and use it in AfterRenderJavaScript:

EventMenuClick handler:

Hashtable result = new Hashtable();
result["url"] = "YourUrl.aspx?id=something";
result["window"] = "windowname";
DayPilotCalendar1.Update(result); // or see the other signatures

AfterRender handler:

AfterRenderJavaScript="if (data && data.url && data.window) { window.open(data.url, data.window); };"
Comment posted by Dan Letecky 1 year ago.

Thnaks for yourquick answer.

That works.

But i use AfterRenderJavaScript for display the warm message. As a result, the message does not display any more ...

I am sure that it is possible to do the function at the same time.

Comment posted by Anonymous 1 year ago.

LOL

I found the solution ...

AfterRenderJavaScript="if (data && data.url && data.window) { window.open(data.url, data.window); }else{afterRender(data)};"

Comment posted by Anonymous 1 year ago.
New Reply
This reply is
Your name (optional):

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