This is a migrated thread and some comments may be shown as answers.

Location of Edit series or occurence dialog

2 Answers 30 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Gavin Pollock
Top achievements
Rank 1
Gavin Pollock asked on 10 Sep 2010, 11:36 AM
Hi there,

Is it possible to use the OnClientRecurrenceActionDialogShowing event to set the location of where the dialog opens on the screen? We have a long vertical list of resources (rooms) on our calendar, and when a recurring appointment is edited the dialog box opens centered vertically on the long scrolling browser window. Often far away from where the user has chosen an appointment, resulting in them having to scroll down to find the dialog to do the edit.

Thanks
Gavin

<script type="text/javascript">
   
function OnClientRecurrenceActionDialogShowing(sender, eventArgs)
   {
       eventArgs.set_cancel(true);   
       //Edit this instance only:   
       //eventArgs.set_editSeries(false);   
              
       //Edit the entire series:   
       eventArgs.set_editSeries(true);
   }        
</script>

2 Answers, 1 is accepted

Sort by
0
Gavin Pollock
Top achievements
Rank 1
answered on 10 Sep 2010, 05:18 PM
Found a solution for this... bit of a hack, but it does the job.

var oEditRecurring;
function OnClientRecurrenceActionDialogShowing(sender, eventArgs)
{
     clearTimeout(oEditRecurring);
     oEditRecurring = setTimeout(MoveEditRecurring, 500);
 }
   
 function getScrollAmount()
 {
     if(typeof window.pageYOffset != "undefined")
     {
         var scroll = window.pageYOffset;
     }
     else if(typeof document.documentElement.scrollTop != "undefined")
     {
         var scroll = document.documentElement.scrollTop;
     }
     else
     {
         var scroll = document.body.scrollTop;
     }
       
     return scroll;
 };
 function MoveEditRecurring()
 {
     var oS = $get('oSched');
     var oTopWrap = oS.childNodes[0];
       
     var oModalW = getChildNodeByClass(oTopWrap, 'rsModalWrapper');
     if (oModalW != null)
     {
         var oModalD = getChildNodeByClass(oModalW, 'rsModalDialog');
         if (oModalD != null) {
             //window.alert(getScrollAmount());
             oModalD.style.top = (getScrollAmount() + 100) + 'px';
         }
     }
}        
 /* getChildNodeByClass
 /**********************/
 function getChildNodeByClass(theParent, theChildClass) {
     for (i = 0; i < theParent.childNodes.length; i++) {
         //Get the first child with the specified class name.
         if (theParent.childNodes[i].className == theChildClass) {
             return theParent.childNodes[i];
         }
     }
     return null;
 }
0
Veronica
Telerik team
answered on 11 Sep 2010, 05:24 PM
Hello Gavin Pollock ,

I'm glad you found the solution on your own. Please let me know if you have more questions.

All the best,
Veronica Milcheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Scheduler
Asked by
Gavin Pollock
Top achievements
Rank 1
Answers by
Gavin Pollock
Top achievements
Rank 1
Veronica
Telerik team
Share this question
or