Kendo Editor MVVM doesnt seem to work with Javascript initialization.

1 Answer 42 Views
Editor MVVM
ChrisM
Top achievements
Rank 1
Iron
Iron
ChrisM asked on 29 Aug 2024, 02:29 PM

While Kendo Editor MVVM works with "data" attributes, if I try to use it with Javascript initialization MVVM doesnt work.

WORKING

  <textarea id="bodyEditor1" data-role="editor"                
                      data-bind="visible: isVisible,
                                value: html,
                                events: { change: onChange }"
                      style="height: 100px;"></textarea>

 

NOT WORKING

<textarea id="bodyEditor2" style="height: 100px;"></textarea>

 $("#bodyEditor2").kendoEditor({
    
        bind: "visible: isVisible, value: html, events: { change: onChange }"
 
        }).data("kendoEditor");

 

 

I was trying to set the "encoded" property to false and neither this worked correctly.

 

Full dojo:

https://dojo.telerik.com/@ChrisMylonas/IpuWoQUP

 

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 03 Sep 2024, 10:52 AM

Hello, Chris,

Using the kendoEditor method to initialize the component in the MVVM pattern is not a valid one. The kendoEditor() method accepts only configurations listed in the API reference.

In order to create an MVVM bound Editor, you will need to follow the WORKING code you shared.

Let me know if you have any further questions.

Regards,
Martin
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Editor MVVM
Asked by
ChrisM
Top achievements
Rank 1
Iron
Iron
Answers by
Martin
Telerik team
Share this question
or