AllowResize Vertically

4 posts, 1 answers
  1. Mak
    Mak avatar
    39 posts
    Member since:
    Oct 2008

    Posted 14 Jun 2012 Link to this post

    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.
  2. Answer
    Rumen
    Admin
    Rumen avatar
    13849 posts

    Posted 14 Jun 2012 Link to this post

    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.
  3. Steven
    Steven avatar
    81 posts
    Member since:
    Dec 2011

    Posted 13 May 2013 Link to this post

    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
            });
        });
    }
  4. Steven
    Steven avatar
    81 posts
    Member since:
    Dec 2011

    Posted 13 May 2013 Link to this post

    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)
            });
        });
    });
Back to Top