A custom modal popup form closes periodically - how can this be overcome with other DayPilot controls?
Asked by mrplatypus (aka Dave) 10 years ago.
Hi Dan and Team,
I'm trying to get a button to display a modal form so that the user can perform other tasks to the application while keeping the main form populated underneath.
My issue is that also on the same page there are other DayPilot controls:
DayPilotScheduler; DayPilotMenu; DayPilotNavigator
The modal form displays but does not stay open, obviously to a screen refresh in one of the controls.
The DayPilotScheduler control, I know, makes use of a modal dialog box in order to perform other processes and that does not "timeout" and disappear from the screen.
Please advise on how I can implement this with the controls at my disposal?
It refreshes the events every 10 seconds. Clicking an event opens the modal dialog. In my tests it stays open even if after the refresh.
Just a few things to explore:
1. Does the page fully reloads? You'd see a full page GET request in the Network tab of developer tools in this case. That would redraw the whole page and the modal dialog would get hidden in that case.
2. Do you use AfterRenderJavaScript? Maybe there is something in that event handler that either refreshes the page or closes the dialog.
3. Anything suspicious in the browser console (JavaScript error, etc.)?
Comment posted by mrplatypus (aka Dave) 10 years ago.
Dan,
1) As far as I can see, yes the page fully reloads
2) Yes the "AfterRenderJavaScript" property of the daypilotscheduler is in use.
3) No, I cannot see anything suspicious
Dave
Comment posted by Dan Letecky [DayPilot] 10 years ago.
Is the page reloaded using a POST or GET request?
DayPilot normally doesn't refresh the page - the only exception is a PostBack but that always requires a user action.
The AutoRefresh only uses a CallBack.
Comment posted by mr platypus 10 years ago.
Dan,
Its not a full postback page..
Neither am I using UpdatePanels to do a partial postback..
Presumably then it is a callback call which is hiding the daypilot.modal form.
All I have done is:
1) add a new linkbutton control to the page
2) configured the onclientclick event of the linkbutton to call some javascript
3) the javascript then makes use of the daypilot.modal control to view the target page..
Is this the correct approach I should be using or is there another way?
Please advise.
Thanks
Dave
Answer posted by Dan Letecky [DayPilot] 10 years ago.
Dave,
It looks like the LinkButton might reload the page. Adding the OnClientClick event handler doesn't prevent the default action (PostBack). Can you try adding "return false;" to the event handler, like this?