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

Resize View HTML window?

2 Answers 277 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Bryan
Top achievements
Rank 1
Bryan asked on 12 Jun 2018, 03:23 PM
My users are wanting a way to enlarge or resize the window that pops up when they click the View HTML button in the Editor widget. Is there a way to do this or is beyond the developer's control? Thanks.

2 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 14 Jun 2018, 07:54 AM
Hello Bryan,

You can try to modify the ViewHtml Window options by subscribing to the Editor's execute event. In the event handler, retrieve the Widnow instance and modify the width option with the setOptions() method as follows:
@(Html.Kendo().Editor()
.Name("editor")
.HtmlAttributes(new { style = "width: 100%;height:440px" })
.Tools(tools => tools
 .Clear()             
 .ViewHtml()           
)
.Events(e => e.Execute("onExecute"))     
)
 
<script>
function onExecute(e) {
 if (e.name == "viewhtml") {
 setTimeout(function () {
 var window = $(".k-editor-dialog").getKendoWindow();
 window.setOptions({ width: 1000 });
 });
 }
}
</script>

In addition to the above, you might also need to modify the textarea styling to fit the new Window width:
<style>
    .k-editor-dialog .k-editor-textarea {
        min-width: 100%;
    }
</style>

I hope this helps.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Bryan
Top achievements
Rank 1
answered on 15 Jun 2018, 03:11 PM
Thanks, that helped a lot.
Tags
Editor
Asked by
Bryan
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Bryan
Top achievements
Rank 1
Share this question
or