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

Table formatting lost after saving a list item

4 Answers 86 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
Mathworks SharePoint Administrator
Top achievements
Rank 1
Mathworks SharePoint Administrator asked on 06 Apr 2010, 05:09 PM
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.

4 Answers, 1 is accepted

Sort by
0
Stanimir
Telerik team
answered on 07 Apr 2010, 12:08 PM
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.
0
Mathworks SharePoint Administrator
Top achievements
Rank 1
answered on 07 Apr 2010, 04:40 PM
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!
0
Muhamad Rizqi
Top achievements
Rank 1
answered on 11 Jun 2010, 06:36 PM
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.
0
Stanimir
Telerik team
answered on 14 Jun 2010, 09:06 AM
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.
Tags
WebParts for SharePoint
Asked by
Mathworks SharePoint Administrator
Top achievements
Rank 1
Answers by
Stanimir
Telerik team
Mathworks SharePoint Administrator
Top achievements
Rank 1
Muhamad Rizqi
Top achievements
Rank 1
Share this question
or