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

Clientside advanced forms (reloading form data)

2 Answers 87 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 23 Mar 2011, 04:23 PM
Hello,

I am using the scheduler in a project with a webservice and a custom dbschedulerprovider (all working very nicely).

I am now making a custom advanced form to handle the appointment data.  My problem is that I need to reload the controls on my form as the data loaded (in the combo boxes) changes in relation to which appointment has been opened.

I have been looking at the OnClientFormCreated event for a way to do this.  This is what is in the example.

function OnClientFormCreated(scheduler, eventArgs) {
               // Create a client-side object only for the advanced templates
               var mode = eventArgs.get_mode();
               if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert ||
                   mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) {
                   // Initialize the client-side object for the advanced form
                   var formElement = eventArgs.get_formElement();
                   var templateKey = scheduler.get_id() + "_" + mode;
                   var advancedTemplate = schedulerTemplates[templateKey];
                   if (!advancedTemplate) {
                       // Initialize the template for this RadScheduler instance
                       // and cache it in the schedulerTemplates dictionary
                       var schedulerElement = scheduler.get_element();
                       var isModal = scheduler.get_advancedFormSettings().modal;
                       advancedTemplate = new window.SchedulerAdvancedTemplate(schedulerElement, formElement, isModal);
                       advancedTemplate.initialize();
 
                       schedulerTemplates[templateKey] = advancedTemplate;
                   }
 
                   // Are we using Web Service data binding?
                   if (!scheduler.get_webServiceSettings().get_isEmpty()) {
                       // Populate the form with the appointment data
                       var apt = eventArgs.get_appointment();
                       var isInsert = mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert;
                       var editSeries = eventArgs.get_editingRecurringSeries();
                       advancedTemplate.populate(apt, isInsert, editSeries);
                   }
               }

I would be grateful if you could direct me to more detailed information regarding this or any examples that demonstrate my required functionality.

Best Regards,
Michael

2 Answers, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 23 Mar 2011, 05:16 PM
0
Veronica
Telerik team
answered on 26 Mar 2011, 09:07 AM
Hi Michael,

Yes, this help article can point you for how to replace the advanced edit form. Please feel free to ask me if you have further questions.

Best wishes,
Veronica Milcheva
the Telerik team
Tags
Scheduler
Asked by
Michael
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
Veronica
Telerik team
Share this question
or