This is a migrated thread and some comments may be shown as answers.
Duplicated Editor with k-ng-model after configuring tools
2 Answers 10 Views
This is a migrated thread and some comments may be shown as answers.
Jan
Top achievements
Rank 1
Jan asked on 31 May 2016, 09:29 AM

Hi,

Like you see it on this example: http://dojo.telerik.com/@Janek91/AbUSE if I try to change available tools in the embedded Editor - in result I'm getting it duplicated, that's because I'm using k-ng-model directive. There is a possible workaround here: http://dojo.telerik.com/@Janek91/Eseva I can simply use Angular to paste HTML into <textarea> tag and not to use k-ng-model. But is there really no other way to use k-ng-model, configure tools and don't get duplicated Editor?

2 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 01 Jun 2016, 07:22 AM
Hi Jan,

The same questions is already posted in support ticket. I suggest you to continue the conversation there. 

For anyone interested in the situation: The main problem is that Kendo Editor is intialized two times by using this implementation. 

In this article it is documented how to configure Kendo widgets using Angular approaches—http://docs.telerik.com/kendo-ui/AngularJS/introduction.

Suggestions for the case here:

  1. The most effective and simple one is to use the k-tools with an array of the tools you need to have: 

    <textarea id="editor" kendo-editor k-ng-model="html" k-tools="['bold', 'italic']"></textarea>


  2. Similar approach is to define the array in the $scope of the module and set it as a value to the k-tools attribute—http://dojo.telerik.com/uPoRu;


  3. If you need to fine-tune the widget similar to JavaScript initialization you can define the options in the $scope and set the k-options attribute to the object's name—http://dojo.telerik.com/uPoRu/3.

  4. If, however, you need to not use the Angular $scope and attributes to configure the widget you can still get the instance by using the data() method and modify its options by using the setOptions method. Here you are an example—http://dojo.telerik.com/uPoRu/2.


Regards,
Ianko
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Jan
Top achievements
Rank 1
answered on 01 Jun 2016, 09:52 AM

Hi,

I've noticed ticket option after I posted question here, so I'm sorry for that information mess. Thank you very much for a quick and satisfying answer. I need to read documentation more carefully. Everything works fine now.

Asked by
Jan
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Jan
Top achievements
Rank 1
Share this question
or