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

RadEditor Issues

6 Answers 137 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Anand
Top achievements
Rank 1
Anand asked on 29 Aug 2011, 10:37 AM
Hi,

This is my code ,

<telerik:RadEditor runat="server" OnClientSubmit="OnClientSubmit" ID="RadEditor1" 
ContentFilters="None">
<Content>
<table width="100%" cellspacing="0" cellpadding="0" border="0" align="left" style="background-color: #ffffff; margin: 0px;"><tbody><tr><td valign="top" align="right"> <img alt=""  src="/editorQ2SP12008/Images/Deisy.jpg"  align="left" /></td></tr></tbody></table>
</Content>
</telerik:RadEditor>
------------------------------------------------------------------------------------------------------------------
Facing Issue  :
1 ] When i change ContentFilters="None"  ---- > in browser Firefox Changing the Hex colour(style="COLOR: #000000") to RGB(style="color: rgb(0, 0, 0)).
2 ] When i change ContentFilters="ConvertToXhtml" ---- >  align="left"  (inside Img Tag name) converting to style="float: left;".


Please help me out as soon as possible.

Thanks 
Anand

6 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 29 Aug 2011, 11:13 AM
Hello Anand,

Try the following ContentFilters="ConvertInlineStylesToAttributes,ConvertToXhtml".

The ConvertInlineStylesToAttributes filter will convert the inline styles to attributes.

Regards,
Rumen
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Anand
Top achievements
Rank 1
answered on 29 Aug 2011, 12:25 PM
Hi

Getting below error :

Cannot create an object of type 'Telerik.Web.UI.EditorFilters' from its string representation 'ConvertInlineStylesToAttributes,ConvertToXhtml' for the 'ContentFilters' property


Thanks 
Anand
0
Rumen
Telerik team
answered on 29 Aug 2011, 01:26 PM
It seems that you are using an older version of RadEditor which does not offer the ConvertInlineStylesToAttributes filter. The recommended approach is to migrate to the latest one Q2 2011 to solve the problem.


Regards,
Rumen
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Anand
Top achievements
Rank 1
answered on 30 Aug 2011, 06:03 AM
Ok fine,

Another doubt:

This works fine on IE for windows. Nothing happens in Firefox.

  function OnClientLoad(editor) {
            //debugger;
       var tree = $find('RadTreeView1');
        makeUnselectable(tree.get_element());
        editor.attachEventHandler("oncontrolselect", function() {
        window.setTimeout(function() {
                    var selElem = editor.getSelection().getParentElement();
                    if (selElem.tagName == "IMG") {
                        curWidth = selElem.offsetWidth;
                        curHeight = selElem.offsetHeight;
                        selElem.onresizeend = function(e) {
                        radalert('Image cannot be resize', 330, 100, 'Message');
                            selElem.style.width = curWidth;
                            selElem.style.height = curHeight;
                        };
                    }
                }, 100);
            });
        }

Please help me out

Thanks 
Anand
0
Anand
Top achievements
Rank 1
answered on 30 Aug 2011, 07:25 AM
Hi,

Please find attached screenshot (DLL Version used).

Thanks 
Anand
0
Rumen
Telerik team
answered on 31 Aug 2011, 03:56 PM
Hello Anand,

) Yes, the oncontrolselect event is supported and offered by IE only.  You can see whether the editor's OnClientselectionChange event could be helpful for your scenario:

<script type="text/javascript">

function OnClientSelectionChange(editor, args)

{

alert("The tag of the selected Element is: " + editor.getSelectedElement().tagName);

}

</script>

<telerik:radeditor runat="server" ID="RadEditor1"

OnClientSelectionChange="OnClientSelectionChange">

<Content>

<strong>Sample Content <img src="aaa.jpg"/></strong>

</Content>


You can also see how to attach to the content area events in this article and try to implement your own solution.

If you would like you can disable the image resizing in IE by setting the unselectable="on" attribute to all IMG tags in the content area, then the browser will not display the image handlers, e.g.

<script type="text/javascript">
function OnClientSelectionChange(editor)
{
var images = editor.get_document().getElementsByTagName("IMG");
for (var i = 0; i < images.length; i++)
{
var image = images[i];
image.setAttribute("unselectable", "on");
}
}
</script>

<telerik:RadEditor ID="RadEditor1"

OnClientSelectionChange="OnClientSelectionChange"

runat="server" Width="100%" Height="345px">
<Content>
<img src="http://www.telerik.com/DEMOS/ASPNET/RadControls/Editor/Skins/Default/buttons/CustomDialog.gif"/>
<a href="www.telerik.com">telerik</a>
<img src="http://www.telerik.com/DEMOS/ASPNET/RadControls/Editor/Skins/Default/buttons/CustomDialog.gif"/>
</Content>
</telerik:RadEditor>

The unselectable attribute is supported by IE. Opera, Chrome and Safari do not offer resize handlers for the images.



Regards,
Rumen
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Editor
Asked by
Anand
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Anand
Top achievements
Rank 1
Share this question
or