4 Answers, 1 is accepted
Hello John,
You can achieve this either by adding a stylesheet to the editor content via the stylesheets configuration option, or via JavaScript by accessing the body field (the example in the documentation shows exactly this).
Regards,Alex Gyoshev
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Without the <script> code I get
which look nice, except I want it with a gray background. When I add the <script> code
$("#editor").kendoEditor();
var editor = $("#editor").data("kendoEditor");
editor.body.style.backgroundColor = "gray";
I get this.
I have attached my .cshtml file in Test.zip
Hello John,
Based on the screenshots that you posted, it appears that you are initializing the editor twice on the same element, which is not supported. Instead, get hold of the editor instance and use the body field:
@(Html.Kendo().Editor().Name("editor"))
<script>
$("#editor").data("kendoEditor").body.style.background = "gray";
</script>
Alex Gyoshev
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.