Confirm message for updating the appointment

8 posts, 0 answers
  1. ESM Dev
    ESM Dev avatar
    15 posts
    Member since:
    Apr 2009

    Posted 15 Apr 2009 Link to this post

    Hello Team,

    I have a requirement like when the user try to update the appointment by dragging the appointment then it should popup a confirm box and if user clicks on ok then it should update other wise not. its just like the existing delete functionality. could you please let me know how to achieve this.

    Thanks,
    Ram
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2834 posts

    Posted 17 Apr 2009 Link to this post

    Hello,

    You can use the AppointmentMoveEnd event to ask the user for confirmation:

    function aptMoveEnd(sender, eventArgs)
    {
        if (!confirm("Confirm move?"))
        {           
            eventArgs.set_cancel(true);
        }
    }

    That is if it wasn't for a bug in RadScheduler that will cause it to abort the drag while the confirmation dialog is still shown. We're working to resolve it, but in the meantime you'll have to use this code:

    function aptMoveEnd(sender, eventArgs)
    {
        sender._dragging = false;

        if (!confirm("Confirm move?"))
        {           
            eventArgs.set_cancel(true);
        }
       
        sender._dragging = true;
    }

    I hope this helps.

    Best wishes,
    Tsvetomir Tsonev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. ESM Dev
    ESM Dev avatar
    15 posts
    Member since:
    Apr 2009

    Posted 17 Apr 2009 Link to this post

    Thanks for your help its fine for dragging. now i need one more that when i change only the end time to that appointment just pulling the bottom of the appointment to the required end date then it should ask a confirmation to the user. could you please give me code for this also.
  4. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 20 Apr 2009 Link to this post

    Hi ESM Dev,

    You can hook onto the OnClientAppointmentResize event and use the same code as for the drag and drop:

    function aptResizeEnd(sender, eventArgs)
    {
                if (!confirm("Confirm resize?"))
                {
                    eventArgs.set_cancel(true);
                }
    }

    All the best,
    Genady Sergeev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. sharad
    sharad avatar
    1 posts
    Member since:
    Mar 2009

    Posted 07 May 2009 Link to this post

            function AppointmentResizeEnd(sender, eventArgs)
            {
                sender._dragging = false;
                if (!confirm("Do you want to change appointment time?"))
                {            
                    eventArgs.set_cancel(true);
                }
                sender._dragging = true;
            }

    Prompts error at 
    sender._dragging = true;
       when appointment confirmation box is cancelled twice

    Error msg
    Microsoft JScript runtime error: 'this._draggingAppointment' is null or not an object


  6. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 11 May 2009 Link to this post

    Hi sharad,

    I have tried to reproduce the error, however on my end there is no error after clicking cancel twice. Is there something specific concerning your project? I am attaching my test project to this replay.

    Regards,
    Genady Sergeev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  7. Stefan
    Stefan avatar
    15 posts
    Member since:
    Sep 2012

    Posted 08 May 2013 Link to this post

    Is there someway to do this without using the !confirm(textString)?

     Im using the code on the Schedule, OnClientAppointmentMoveEnd event.

    I would like to show a radconfirm.

    radconfirm(textString, confirmAppointmentMoveFn, 400, 100, null, "Flytt av bokning", null);
  8. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    2062 posts

    Posted 13 May 2013 Link to this post

    Hello,

    I would suggest reviewing our RadScheduler client-side API demo that implements very similar scenario - when user tries to move an appointment that will overlap an already existing appointment, a radconfirm window pops up. Based on the selected option the appointment will be moved to the new time slot or moving will be canceled.

    Regards,
    Boyan Dimitrov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top