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

Setting default content for an specific editor

3 Answers 66 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
SEE Global IT Development Team
Top achievements
Rank 2
SEE Global IT Development Team asked on 03 Dec 2009, 11:24 AM
Hi

I have a list in a SharePoint site. This list has several columns of multiple lines of text / rich text ie. several radeditor controls. When entering a new item, I would like that each of the radeditors will have a default text like "insert here the info regarding this" or "please remember to specify this and that".

When i dont have the radeditor enabled in the site, I am able to achieve the above metioned in the default SharePoint editor using some simple javascript. But i dont seem to be able to do the same when the radeditor is enabled.

I have been looking in the forums and I found some info on how to change the overall behaviour of the editor, but that does not seems to appliyt to my scenario. Any help will be very much appreciated.

Thanks!
-Cristina.

3 Answers, 1 is accepted

Sort by
0
Stanimir
Telerik team
answered on 04 Dec 2009, 03:55 PM
Hello Cristina Vega,

In order to achieve the desired functionality follow these steps.
1. Add the following code to the respective ListConfigFile.xml, which is located in the /Program Files/Common Files/Microsoft Shared/web server extensions/wpresources/RadEditorSharePoint/4.x.x.x__1f131a624888eeed/RadControls/Editor folder.
<property name="OnClientLoad">RadEditorOnClientLoad</property>

2. Make sure that you add the following javascript method to the page before the RadEditor is called.
function RadEditorOnClientLoad(editor, args)
{
    var oValue = editor.GetHtml(true);
    if (!oValue)
    {
        editor.PasteHtml('insert here the info regarding this');
    }
}

I hope this helps.


Sincerely yours,
Stanimir
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
SEE Global IT Development Team
Top achievements
Rank 2
answered on 14 Oct 2010, 02:15 PM
Hi

I have tried the suggested solution, but does not seem to be working.

I can see the method RadEditorOnClientLoad is actually called (i have added a debug alert) but the text is not load. I have several radeditors in the same form and i want to add different to all of them (as it is now, the text is not load at all, not even in one).

How can the different radeditors in the form be identified so the text is added to them appropiately?

Thank you!
0
Stanimir
Telerik team
answered on 18 Oct 2010, 03:09 PM
Hi Cristina Vega,

What I suggest you to do is upgrade to the latest version of RadEditor, which is based on the ASP.NET AJAX version of RadEditor.

We offer a fully-featured trial version of the RadEditor for MOSS v5. It has everything from the paid commercial version and the only difference is that it randomly displays a license message when the editor loads. You can download the trial from the RadControls for ASP.NET AJAX trials page on our site.

You can find the upgrade instructions in the following online help article: Upgrade Instructions from version 4.x to version 5.x .

All the best,
Stanimir
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
WebParts for SharePoint
Asked by
SEE Global IT Development Team
Top achievements
Rank 2
Answers by
Stanimir
Telerik team
SEE Global IT Development Team
Top achievements
Rank 2
Share this question
or