RadEditor Height problem (NumberOfLines)

5 posts, 0 answers
  1. Göran Tänzer
    Göran Tänzer avatar
    8 posts
    Member since:
    Jun 2004

    Posted 20 Sep 2010 Link to this post

    Hi

    our users are complaining about the height of the RadEditor in Annoucment Lists. I have reviewed our configuration and looked at the HTML markup rendered by RadEditor and I was suprised to see that the height is not 400px as defined in the config.xml files (which seems to be the default value anyway). The height is acutally 210px for a OOTB Announcement List.

    I started investigating and I looked at the RadTextfield class and there is a if condition which checks for the NumberOfLines property of the multiline field and if more than 6 lines are defined the height gets somehow calculated...

    if (this.baseField.NumberOfLines > 6)
    {
        this.Height = (this.baseField.NumberOfLines * this.FontSizeCoef) * 2;
    }

    Using the default value of 6 lines resuls in a regular sized editor based on the config values (e.g. 400px). Using a higher number results in some calculation which will (at least in our configuraiton) render much to small editor windows.
    I don't want to tell our editor to replace the Annoucement List line number to 6 after creating a new list as a workaround. Is it possible to change this behavior? Is it possible to configure the FontSizeCoef property?
    I attached a screenshot as reference.

    Version: 7.5.2.0 / 2010.1.415.20

    thanks
    regards
    göran
  2. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 21 Sep 2010 Link to this post

    Hi Göran,

    You can set the Height property in the respective ListConfigFile.xml. For example add the following code:
    <property name="Height">400px</property>
    However this will affect all RadEditor fields in list scenario.

    Is it possible to configure the FontSizeCoef property? - At this point it is not possible to configure this property. If you open an official support ticket and you have the correct license information, I will provide you with the source code of RadEditor for MOSS so you will be able to create your own custom version of the control. Just specify exactly which version of RadEditor for MOSS you are using. The latest one is 5.8.1.


    Best wishes,
    Stanimir
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

  3. Göran Tänzer
    Göran Tänzer avatar
    8 posts
    Member since:
    Jun 2004

    Posted 21 Sep 2010 Link to this post

    Hi Stanimir

    we do not own a source code license.
    I have already set the width and height in the ConfigFile.xml and ListConfigFile.xml. The setting works perfect but if more than 6 "Number of lines for editing" are defined for a "Multiple lines of text" column the RadEditor ignores the height property of the config file and does some calculations.
    I think this makes no sense ;) but more important I can't see this officially documented. So I just wonder how I could overcome this behavior?

    regards
    göran
  4. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 23 Sep 2010 Link to this post

    Hello Göran Tänzer,

    I can provide you with the following workaround.
    1. Add the following code to the ListConfigFile.xml, which is located in the /Program Files/Common Files/Microsoft Shared/web server extensions/wpresources/RadEditorSharePoint/5.x.x.0__1f131a624888eeed/Resources/ folder:
    <property name="OnClientLoad">OnClientLoad</property>

    2. Add the following javascript code in the MOSSEditorTools.js file, which is located in the mentioned above folder:
    function OnClientLoad(editor, args)
    {
        window.setTimeout(function ()
        {
            var height = parseInt(editor.get_element().style.height);
            // you can change 250 to what ever fits your scenario
            if (!isNaN(height) && height < 250)
            {
                // you can change 500 - width, 600 - height to what ever fits your scenario
                editor.setSize("500", "600");
            }
        }, 100);
    }


    I hope this helps.

    Greetings,
    Stanimir
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Göran Tänzer
    Göran Tänzer avatar
    8 posts
    Member since:
    Jun 2004

    Posted 23 Sep 2010 Link to this post

    Thanks Stanimir, overwriting the OnClientLoad mehtods works perfectly.
    regards
    göran
Back to Top