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

Run clientside javascript when RadEditor auto-sizes

6 Answers 95 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 05 Apr 2017, 02:22 PM

I've tried following the directions in: http://www.telerik.com/forums/what-event-is-fired-on-resize  but it doesn't appear that onResizeEnd is called when auto resizing.

I have the RadEditor inside a RadWindow and I need to run some javascript to resize the RadWindow when the RadEditor auto-sizes.  Can I get some direction about what event to trap on so I can run my javascript to resize my Rad Window manually?

Thanks!

6 Answers, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 14 Apr 2017, 03:53 PM

Bump.  Can I get some help, Rumen? Ianko?  Thanks!

 

Surely there is some client side event when the RadEditor auto sizes...

0
Michael
Top achievements
Rank 1
answered on 21 Apr 2017, 09:03 PM

Bump.

0
Michael
Top achievements
Rank 1
answered on 01 May 2017, 02:51 PM
Rumen?
0
Rumen
Telerik team
answered on 01 May 2017, 03:17 PM
Hello,

Can you check the following resource:
http://www.telerik.com/support/code-library/resizing-radeditor-to-fill-a-container?


Regards,
Rumen
Telerik by Progress
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.
0
Michael
Top achievements
Rank 1
answered on 01 May 2017, 03:23 PM

Thanks for the reply but that is the exact opposite of what I am trying to do.

 

I am using the auto-resize feature of the RadEditor with great success.  However, when it auto-resizes I need to run some client side javascript to resize some other elements on my page.  I've looked into some other 3rd party libraries to detect when the div containing the RadEditor changes height but this seems very wasteful and there should be some event in the RadEditor that is firing to cause the resize.  I just need to add another handler to that.

0
Rumen
Telerik team
answered on 01 May 2017, 03:57 PM
Hi,

You can use the following approach to detect when the size of RadEditor is changed:
<script type="text/javascript">
    function OnClientLoad(sender, args) {
        var contentWindow = sender.get_contentWindow();
        $telerik.addExternalHandler(contentWindow, "resize", function () {
            console.log("RadEditor has been resized");
        });
    }
</script>
<telerik:RadEditor runat="server" ID="RadEditor1" AutoResizeHeight="true" OnClientLoad="OnClientLoad">
    <Content>
        test content
    </Content>
</telerik:RadEditor>



In the handler of the resize you can check the new size of the editor or implement additional functionality related to resizing the editor.

Regards,
Rumen
Telerik by Progress
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
Michael
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or