clearing editor fields with jQuery doesn't sync with kendo

2 posts, 0 answers
  1. Paul
    Paul avatar
    24 posts
    Member since:
    Aug 2013

    Posted 10 Sep 2014 Link to this post

    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.
  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2194 posts

    Posted 11 Sep 2014 Link to this post

    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!
     
Back to Top