Table formatting lost after saving a list item

5 posts, 0 answers
  1. Mathworks SharePoint Administrator
    Mathworks SharePoint Administrator avatar
    2 posts
    Member since:
    Oct 2008

    Posted 06 Apr 2010 Link to this post

    In a list with rich-text fields (radeditor for lists is enabled on the site) the rdeditor works fine except when a user creates custom tables.  If they edit them and then save they are fine.  If they come back and edit the item without touching the rich text fields the tables lose their formatting.  Any thoughts?  We are using 5.5.0.0.
  2. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 07 Apr 2010 Link to this post

    Hi Mathworks,

    Thank you for the provided information. I was able to reproduce the issue with the latest version of RadEditor for MOSS, which now is 5.7.1. I logged it in our bug tracking system.

    The problem is that when the content is saved the first it is wrapped in a div element with class attribute set to something like ExternalClass31CC2194F4404ED2A3AE1DAAE53ACB03:
    <div class=ExternalClass31CC2194F4404ED2A3AE1DAAE53ACB03>
    If you had the following css class defined in the content
    .telerik-reTable-1
    {border-bottom:0px;border-left:0px;border-collapse:collapse;font-family:Tahoma;border-top:0px;border-right:0px;}

    The MOSS filters modify it and save the following content
    .ExternalClass31CC2194F4404ED2A3AE1DAAE53ACB03 .telerik-reTable-1
    {border-bottom:0px;border-left:0px;border-collapse:collapse;font-family:Tahoma;border-top:0px;border-right:0px;}

    The next time you save the list item it is wrapped in a div element with different class attribute value. For example:
    <div class=ExternalClassBC8E87C9AB8F483BB88071469F8C840B>

    This is why the previously defined
    .ExternalClass31CC2194F4404ED2A3AE1DAAE53ACB03 .telerik-reTable-1
    class will stop working.

    In order to workaround this issue you can create a custom content filter, which will strip .ExternalClass31CC2194F4404ED2A3AE1DAAE53ACB03 class.

    1. Modify the respective 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. Add the following element:
    <property name="OnClientLoad">OnClientLoad</property>
    2. Add the following javascript to the MOSSEditorTools.js, which is located in the mentioned above folder:
    function OnClientLoad(editor, args)
    {
        editor.get_filtersManager().add(new MyFilter());
    }
    MyFilter = function()
    {
        MyFilter.initializeBase(this);
        this.set_isDom(false);
        this.set_enabled(true);
        this.set_name("RadEditor filter");
        this.set_description("RadEditor filter description");
    }
    MyFilter.prototype =
    {
        getHtmlContent: function(content)
        {
            var newContent = content;
            //Make changes to the content and return it
            newContent = newContent.replace(/\.ExternalClass[^ ]* /ig, "");
            return newContent;
        }
    }
    MyFilter.registerClass('MyFilter', Telerik.Web.UI.Editor.Filter);



    Kind regards,
    Stanimir
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

  3. Mathworks SharePoint Administrator
    Mathworks SharePoint Administrator avatar
    2 posts
    Member since:
    Oct 2008

    Posted 07 Apr 2010 Link to this post

    That seems to be working well for me.  I will have the user test it and hopefully they are all set.  Thanks for the response!
  4. Muhamad Rizqi
    Muhamad Rizqi avatar
    1 posts
    Member since:
    Mar 2010

    Posted 11 Jun 2010 Link to this post

    The solution work perfectly, but unfortunately the users must perform a hard-refresh (ctrl+F5) on their browser to reload the modified JS file. Is there a way to avoid this? Thank you.
  5. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 14 Jun 2010 Link to this post

    Hi Muhamad Rizqi,

    Unfortunately the files are stored in the browser's cache. So the user must either perform ctrl+F5 refresh or clean the cache manually.


    All the best,
    Stanimir
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top