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

How to set value to Editor with jQuery

1 Answer 1268 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Cooper
Top achievements
Rank 1
Cooper asked on 16 Sep 2014, 10:21 AM
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




1 Answer, 1 is accepted

Sort by
1
Accepted
Dimiter Madjarov
Telerik team
answered on 16 Sep 2014, 11:27 AM
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.

 
Tags
Editor
Asked by
Cooper
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or