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

Can't remove toolbar

7 Answers 692 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Andreas
Top achievements
Rank 1
Andreas asked on 04 Sep 2018, 06:29 AM

Hi, Im doing this, but all tools in toolbar are showing? Shouldn't .Clear() do the trick? FYI: Id and body in code below is set from mvc c# variables

@(Html.Kendo().Editor()
                .Name(id)
                .Events(events => events
                    .Keyup(change)
                )
                .Tools(tools => tools.Clear())
                .Value(@<text>
                    @Model.Body
                </text>)
)

 

 

7 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 04 Sep 2018, 02:38 PM
Hello Andreas,

You can hide the toolbar via the following CSS class:

.k-editor-toolbar {
    display: none !important;
}


Best regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
WearySky
Top achievements
Rank 1
answered on 03 May 2019, 03:32 PM
Is this not a bug? The documentation for EditorToolFactory (https://docs.telerik.com/aspnet-mvc/api/Kendo.Mvc.UI.Fluent/EditorToolFactory) specifically says that the Clear() function "clears all tools".
0
Petar
Telerik team
answered on 08 May 2019, 01:45 PM
Hello WearySky,

I cannot be absolutely sure what was the context of Andreas’ application and what could have caused an unexpected behavior with the Editor, but I can confirm that based on our internal tests and the community's feedback, currently there are no known issues reported when using the Clear() method. If there are any issues experienced, we would be happy to hear about and resolve them. 

The Clear() method can be tested using this example from our demo site. Adding 
.Tools(tools=>tools.Clear())
to the definition of the Editor will result in an editor without toolbar.

Regards,
Petar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
WearySky
Top achievements
Rank 1
answered on 08 May 2019, 07:37 PM

Hi Petar,

I saw the exact behaviour described by Andreas, and was googling for a solution when I came across this thread. Doing tools.Clear() and adding calls to other toolbar elements (like in the editor's custom tools or all tools demo pages) will clear it and add only those elements, but doing a simple tools.Clear() results in the default toolbar appearing for me (latest update, in an asp.net core project). I don't see any way to edit the demo on the page that you linked to test out a tools.clear() call though.

0
Petar
Telerik team
answered on 13 May 2019, 03:23 PM
Hi WearSky,

Thank you for the additional info and the usage specifics. Yes, I can confirm that the tools.Clear() is working together with a call to other toolbar element/s.  

To remove the toolbar in the Editor, the tools array could be set to an empty one via setOptions on $(document).ready() like in the following code:
$("#editor").data("kendoEditor").setOptions({
    tools: []
})

You can try the above code and let me know if it works for you. 

Regards,
Petar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
WearySky
Top achievements
Rank 1
answered on 13 May 2019, 03:59 PM

Hi Petar,

I just tried that method, and noticed that it leaves an empty space at the top (which is what I assume tools.Clear() would do, too). So I've just hidden it entirely using this javascript code:

$("#editor").data("kendoEditor").toolbar.element[0]).hide();
0
Petar
Telerik team
answered on 16 May 2019, 10:19 AM
Hi WearSky,

Thank you for sharing!  The provided solution is also a valid approach for hiding Editor's toolbar.  

Regards,
Petar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.

Tags
Editor
Asked by
Andreas
Top achievements
Rank 1
Answers by
Rumen
Telerik team
WearySky
Top achievements
Rank 1
Petar
Telerik team
Share this question
or