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

AllowResize Vertically

3 Answers 106 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Mak
Top achievements
Rank 1
Mak asked on 14 Jun 2012, 03:30 PM
Hi,

Is it possible to limit the resize capability of the Editor so that users may only resize it vertically rather than both vertically and horizontally? Currently we are having to disable all Resize capabilities to prevent the users from breaking the page.

Hope you can help

A.

3 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 14 Jun 2012, 03:44 PM
Hi,

You can achieve the required functionality by manually set max-width CSS rule to the RadEditor to match its width, e.g.:
Copy Code
<telerik:RadEditor runat="server" ID="RadEditor1" Width="600px" style="max-width:600px;">
</telerik:RadEditor>


Regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Steven
Top achievements
Rank 1
answered on 14 May 2013, 02:21 AM
If you look at the JS, the handle is preset to "se" and that is the only item that binds.

I've added the following to my ClientInit method which appears to lock it to vertical re-sizing.
All that remains is an IE Bug that causes the editor to shrink whenever you re-size it

oninit: function(editor) {
    var el = editor.get_element();
    var width = (el.currentStyle || el.style).width;
 
    // ensure proper width
    editor.add_firstShow(function () {
        el.style.width = width;
 
        // lock resizing to just Y coords
        editor._resizeExtender.set_constraints({
            x: width,
            y: 0,
            width: 0,
            height: screen.availHeight
        });
    });
}
0
Steven
Top achievements
Rank 1
answered on 14 May 2013, 03:07 AM
Quick fix for IE shrinking bug

function RadEditor_oninit(editor) {
 
    var el = editor.get_element();
    var width = (el.currentStyle || el.style).width;
 
    editor.add_firstShow(function () {
        // ensure proper width
        el.style.width = width;
 
        // IEBug - set width to eliminate shrinkage
        editor.get_mainTable().style.width = width;
 
        editor._resizeExtender.set_constraints({
            x: parseInt(width),
            y: 0,
            width: 0,
            height: parseInt(screen.availHeight)
        });
    });
});
Tags
Editor
Asked by
Mak
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Steven
Top achievements
Rank 1
Share this question
or