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

clearing editor fields with jQuery doesn't sync with kendo

1 Answer 58 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 10 Sep 2014, 10:34 AM
In my custom editor template, the values of the html input fields only get serialised correctly if I manually enter them. If I use jquery to clear an element, it does not get synced with kendo, and the original values get serialised instead. 

How can I get kendo to sync? Is there a way to set a field through kendo instead?

Cheers, Paul.

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 11 Sep 2014, 08:27 AM
Hi Paul,

Basically the best possible approach would be to get the current model "uid" from the editable container and use it to get the underlying model that is edited. Then you can use the "set" method of the model to change the values of given fields.

e.g.:
var scheduler = $("#scheduler").getKendoScheduler();
//get an editor that is in the scheduler editor container
var modelUid = $("[name=title]").closest("[data-uid]").data("uid");
var model = scheduler.occurrenceByUid("5fc172b7-9838-40d9-871b-b8682aad5475");
model.set("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!
 
Tags
Scheduler
Asked by
Paul
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or