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

RadEditor Height problem (NumberOfLines)

4 Answers 60 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
Göran Tänzer
Top achievements
Rank 1
Göran Tänzer asked on 20 Sep 2010, 02:31 PM
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

4 Answers, 1 is accepted

Sort by
0
Stanimir
Telerik team
answered on 21 Sep 2010, 01:49 PM
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.
0
Göran Tänzer
Top achievements
Rank 1
answered on 21 Sep 2010, 05:50 PM
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
0
Stanimir
Telerik team
answered on 23 Sep 2010, 12:45 PM
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.
0
Göran Tänzer
Top achievements
Rank 1
answered on 23 Sep 2010, 02:19 PM
Thanks Stanimir, overwriting the OnClientLoad mehtods works perfectly.
regards
göran
Tags
WebParts for SharePoint
Asked by
Göran Tänzer
Top achievements
Rank 1
Answers by
Stanimir
Telerik team
Göran Tänzer
Top achievements
Rank 1
Share this question
or