How to set value to Editor with jQuery

2 posts, 1 answers
  1. Cooper
    Cooper avatar
    19 posts
    Member since:
    Mar 2014

    Posted 16 Sep 2014 Link to this post

    Hi telerik Members:

    step1:  I had added    @(Html.Kendo().Editor().name("editor") in view

    step2:  I want to set value to editor,  but   $("#editor").val("XXX")  is not work.

    step3:  I had found the paper : http://www.telerik.com/forums/empty-editor-by-jquery-628e7aaaa9af, 
                var editor = $("#editor").data("kendoEditor");
                editor.value('');  

               But It is not work too.


    Is there some way can set value to editor?    

    thank you. 

    CUID : QD1612651




  2. Answer
    Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 16 Sep 2014 Link to this post

    Hello Cooper,

    Indeed the correct way to set the value of the widget is to retrieve it's instance and use the value() method. Make sure that you are executing the code after the widget is initialized. If the problem is still persisting please send us an example, in which it is reproducing (the cshtml file) so we could assist further.

    Regards,
    Dimiter Madjarov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top