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

Update Appointment from AdvancedForm Postback

1 Answer 82 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Alex Occhipinti
Top achievements
Rank 1
Alex Occhipinti asked on 13 Jul 2010, 10:55 PM
Should be a really simple thing, and I've searched, but didn't come up with much. 

Just need to call the updated method on the AdvancedForm from another button.  I've tried:

Owner.UpdateAppointment(Appointment)

But this didn't seem to do anything good or bad.

Thanks

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 20 Jul 2010, 02:33 PM
Hi Alex,

Hello Waqas,

You can achieve this using the Advanced Templates. Download a demo from here and make the following changes:

AdvancedForm.ascx
Copy Code
<asp:Panel runat="server" ID="ButtonsPanel" CssClass="rsAdvancedSubmitArea">
           <div class="rsAdvButtonWrapper">
               <asp:LinkButton runat="server" ID="UpdateButtonSpecial" Width="120px"
                   CssClass="rsAdvEditSaveSpecial" onclick="UpdateButtonSpecial_Click">
                   <span>Save and send sms</span>
               </asp:LinkButton>
               <asp:LinkButton runat="server" ID="UpdateButton" CssClass="rsAdvEditSave">
                   <span>Save</span>
               </asp:LinkButton>
               <asp:LinkButton runat="server" ID="CancelButton" CssClass="rsAdvEditCancel" CommandName="Cancel"
                   CausesValidation="false">
                   <span><%= Owner.Localization.Cancel %></span>
               </asp:LinkButton>
           </div>
       </asp:Panel>

AdvancedForm.ascx.cs
Copy Code
protected void Page_Load(object sender, EventArgs e)
        {
            UpdateButton.ValidationGroup = Owner.ValidationGroup;
            UpdateButtonSpecial.ValidationGroup = Owner.ValidationGroup;
            UpdateButton.CommandName = Mode == AdvancedFormMode.Edit ? "Update" : "Insert";
            UpdateButtonSpecial.CommandName = Mode == AdvancedFormMode.Edit ? "Update" : "Insert";
              
            InitializeStrings();
  
            if (!FormInitialized)
            {
                PopulateDescriptions();
                InitializeMonthlyRecurrenceControls();
                InitializeYearlyRecurrenceControls();
                PrefillRecurrenceControls();
                UpdateResetExceptionsVisibility();
            }
        }
        protected void UpdateButtonSpecial_Click(object sender, EventArgs e)
        {
            Response.Write("Save and sent sms");
        }

AdvancedForm.js
Copy Code
_initializeClientMode : function ()
   {
       this._clientMode = true;
       var template = this;
       $("a.rsAdvEditSaveSpecial", this._formElement)
           .click(function(e) {
               template._saveClicked();
               $telerik.cancelRawEvent(e);
           })
           .attr("href", "#");
       $("a.rsAdvEditSave", this._formElement)
           .click(function(e) {
               template._saveClicked();
               $telerik.cancelRawEvent(e);
            })
           .attr("href", "#");
             
       $("a.rsAdvEditCancel", this._formElement)
           .click(function(e) {
               template._cancelClicked();
               $telerik.cancelRawEvent(e);
           })
           .attr("href", "#");
   },

You would also need to create your custom background image for the special button. You can apply it via its CssClass.

Copy Code
.rsAdvEditSaveSpecial
     {
         background: none !important;    
     }

Attached please find a sample demo of the required functionality.


Regards,
Peter
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
Alex Occhipinti
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or