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

Change tools at runtime

1 Answer 167 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Arik
Top achievements
Rank 1
Arik asked on 29 Aug 2017, 08:32 AM

I'm using the editor for AngularJS. The tools array is passed to the kendo-editor directive by the k-tools property.
I want to change the tools displayed in the toolbar at runtime. I tried to change the tools array and calling the editor.toolbar.refreshTools() method, but it didn't work.

Is it possible to change the value of the tools array passed and then call some method to re-render the toolbar?
Or is there some other way to change the displayed tools at runtime?

1 Answer, 1 is accepted

Sort by
0
Accepted
Ianko
Telerik team
answered on 30 Aug 2017, 10:29 AM

Hello Arik,

I am afraid there is no possible way to just refresh the tools collection of the Editor's toolbar. Due to its complexity, the entire widget should be destroyed and recreated with a new set of options (or updated ones). You can do that by calling the destroy method

Or, with AngularJS, you can use the k-rebind attribute: http://docs.telerik.com/kendo-ui/AngularJS/introduction#widget-update-upon-option-changes. Like in this example here: http://dojo.telerik.com/arAjAs

Regards,
Ianko
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Editor
Asked by
Arik
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or