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

Can't change the content in readonly editor programmatically

1 Answer 246 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Ewgenij
Top achievements
Rank 1
Veteran
Ewgenij asked on 12 Nov 2020, 05:16 PM
If the editor is in readonly mode, I can't change its contents programmatically. I would expect that the user is not allowed to change the content, but not the developer. See the example below - if I click the button "Click me" the text in the editor does not change. I would expect it to change to "bla".

 

Is that possible in readonly or disabled mode?

 
import { Component } from "@angular/core";
 
@Component({
  selector: "my-app",
  template: `
    <kendo-editor
      [value]="value"
      [readonly]="true"
      style="height: 370px;"
    ></kendo-editor>
    <button (click)="onClickme()">Click me</button>
  `
})
export class AppComponent {
  public value = "eeeeee";
 
  onClickme() {
    this.value = 'bla';
    console.log('clicked');
  }
}

1 Answer, 1 is accepted

Sort by
0
Martin Bechev
Telerik team
answered on 16 Nov 2020, 08:52 AM

Hello Ewgenij,

Thank you for the provided code snippet. I pasted it in the following StackBlitz example, which uses the latest Editor version (1.2.5), and it seems to work as expected:

https://stackblitz.com/edit/angular-hdvdty

For more details on how to update a Kendo package, please check the following article:

https://www.telerik.com/kendo-angular-ui/components/installation/up-to-date/

I hope this helps. Let me know if any further assistance is required for this case.

Regards,
Martin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Editor
Asked by
Ewgenij
Top achievements
Rank 1
Veteran
Answers by
Martin Bechev
Telerik team
Share this question
or