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

Updating event title dynamically

7 Answers 475 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Laurence
Top achievements
Rank 1
Laurence asked on 28 Jul 2015, 03:30 PM

Hello, 

I'd like to update the title field of my event dynamically. I can do this by using jquery to select the title input and updating its value. Example,

$('[name="title"]').val("New Test Title")

 This updated value is based on another dropdown and therefor is evaluated dynamically so cannot be set in the configuration.

 However, when I save the event the title does not save with the updated value. Is there a way I can force the underlying event object to bind to the value dynamically added to the title input. 

Thanks 

7 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 30 Jul 2015, 01:52 PM
Hello,

Please check the example below of correctly updating the edited event "title" field:

function updateTitleOfEditedEvent() {
  var scheduler = $("#scheduler").data("kendoScheduler");
  var editedEventUID = $(".k-scheduler-edit-form").data("uid");
  var event = scheduler.occurrenceByUid(editedEventUID);
  event.set("title", "UPDATED TITLE");
}

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Siddhartha
Top achievements
Rank 1
answered on 17 Nov 2016, 07:10 PM

Hi Vladimir,

given function works when we edit the Task in scheduler and update any field,

but when i try to drag and drop the task from one place to other then it is not working.

var editedEventUID = $(".k-scheduler-edit-form").data("uid");

value of editedEventUID is null in that case.

how to handle both the situation

Thanks

Siddhartha

0
Vladimir Iliev
Telerik team
answered on 18 Nov 2016, 07:41 AM
Hi Siddhartha,

You can achieve the desired behavior by using the available Scheduler events. I created small example utilizing the "moveEnd":



Regards,
Vladimir Iliev
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
0
Siddhartha
Top achievements
Rank 1
answered on 18 Nov 2016, 08:35 AM

Hi Vladimir,

Thanks for reply.

in my case I have two event

Save and now Move End.

when we edit event and click on save it called Save event to perform some action.

when we Drag and Drop event to other place it first calls Move End at the end then it calls Save event.

in my case I have written following code in Save event

var scheduler = $("#scheduler").data("kendoScheduler");
  var editedEventUID = $(".k-scheduler-edit-form").data("uid");
  var event = scheduler.occurrenceByUid(editedEventUID);
  event.set("title", "UPDATED TITLE");

when I drag and drop task to other place var editedEventUID = $(".k-scheduler-edit-form").data("uid"); it return null..

here is my problme

hope now I am clear.

Thanks

Siddhartha

0
Vladimir Iliev
Telerik team
answered on 21 Nov 2016, 08:36 AM
Hi Siddhartha,

From the provided information it's not clear for us what is the exact issue that you are experiencing. Could you please provide runable example (for example in Kendo UI Dojo) where it can be reproduced?

Regards,
Vladimir Iliev
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
0
Siddhartha
Top achievements
Rank 1
answered on 28 Nov 2016, 05:38 PM

Hi Vladimir,

i dont have runnable example at this moment. but let me explain my problme.

i have function which i am calling at the time of same the event.

save: appointment_save,

in this function i have following function:

 var scheduler = $("#schedulerS1").data("kendoScheduler");
            var editedEventUID = $(".k-scheduler-edit-form").data("uid");

when i double click on event and save it is working.

but when i am trying to drag and drop then $(".k-scheduler-edit-form").data("uid"); return null.

i think "k-scheduler-edit-form" this is for editing form 

i also want for drag and drop.

Thanks

Siddhartha

 

0
Vladimir Iliev
Telerik team
answered on 29 Nov 2016, 10:14 AM
Hello Laurence,

Thank you for the last clarification. Please note that the Scheduler "moveend" and "save" events receive the currently edited event as parameter. That why the "save" event can be modified as follows:

save: function(e) {
      e.event.set("title", "UPDATED TITLE");
},

Also you can skip using the "moveend" event if you always update the title in the "save" event.

Regards,
Vladimir Iliev
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
Tags
Scheduler
Asked by
Laurence
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Siddhartha
Top achievements
Rank 1
Share this question
or