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
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
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
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
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
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
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
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