Setting default content for an specific editor

4 posts, 0 answers
  1. SEE Global IT Development Team
    SEE Global IT Development Team avatar
    7 posts
    Member since:
    Nov 2008

    Posted 03 Dec 2009 Link to this post

    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.
  2. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 04 Dec 2009 Link to this post

    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.

  3. SEE Global IT Development Team
    SEE Global IT Development Team avatar
    7 posts
    Member since:
    Nov 2008

    Posted 14 Oct 2010 Link to this post

    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!
  4. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 18 Oct 2010 Link to this post

    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.
Back to Top