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

span tag not working in new radeditor

16 Answers 155 Views
Editor
This is a migrated thread and some comments may be shown as answers.
vishal
Top achievements
Rank 1
vishal asked on 20 Sep 2010, 11:27 AM

I am using radeditor’s old version and now i want to upgrade to new one.

I downloaded the trial version and problem I am facing is, when I insert any ‘<span’> tag in radeditor, and try to read  the content of radeditor I am getting <font> tag instead of <span> tag.

 

For ex.

$find("RadEditor1").set_html('<span> hi </span>');

alert($find("RadEditor1").get_html());

 

I am getting alert ‘<font>hi</font>’ instead of ‘<span>hi</span>’.

16 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 22 Sep 2010, 02:23 PM
Hi Vishal,


The span tags are converted to font tags in Design mode, because the browser's commands like FontSize, FontName, etc work with font tags.
Set the true parameter in the get_html method to obtain the content through the editor's filters:

alert($find("RadEditor1").get_html(true));


Sincerely yours,
Rumen
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
vishal
Top achievements
Rank 1
answered on 22 Sep 2010, 02:59 PM
hi rumen,
thanks for your reply. it is working fine now.

but there is one more issues in new editor which i want to share with you..
if there is any html content containing span inside table, radeditor changes the content.

                3.1) go to page http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx

                3.2) go to html mode

                3.3) paste this content

                                <table>

                                <tr><td> <span > hi this is fine </span> </td></tr>

                                <span>

                                <tr><td> this tag will not work in radeditor</td></tr>

                                </span>

                                </table>

                3.4) go to design mode

                3.5) go to html mode again. it looks like this

                                <><span>

                                   <tr />

                                                <td />this tag will not work in radeditor</span></>

                                </tbody>

0
Rumen
Telerik team
answered on 22 Sep 2010, 03:09 PM
Hi Vishal,

The problem is that you cannot have any element different <td> inside <tr> elements. In other case this content will be invalid  XHTML content and the browser will automatically validate it. To verify this test the attached editable IFRAME element using the same Rich Text Editing engine of the browser as RadEditor.

What you can do is to disable the ConvertToXhtml filter or instruct your users to validate the content using the W3C validator dialog of RadEditor.

All the best,
Rumen
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
vishal
Top achievements
Rank 1
answered on 24 Sep 2010, 09:41 AM
i tried using spellchecker in new radeditor
i added this tag in httphandlers of my web.cofig file:
<add verb="*" validate="false" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI"/>

Telerik.Web.UI.Editor.CommandList.SpellCheck = function(commandName, editor) {
         var spell = GetRadSpell('<%= RadSpell1.ClientID %>');  
         spell.spellCheck(new PrometheusTextSource(editor));  
         return false;  
        }  
        var PrometheusTextSource = function(editor)  
        {  
         this._editor = editor;  
         this.get_text = function() { return this._editor.get_html(); };  
         this.set_text = function(value) { this._editor.set_html(value); };  
        }  
but it is giving me error.. web.config registration missing..
can you send me small demo page where radspell working fine with radeditor. so it will help me..
0
Rumen
Telerik team
answered on 24 Sep 2010, 01:35 PM
Hello Vishal,

Please, find attached the requested sample project made on VS2010 / ASP.NET 4.0.

Best wishes,
Rumen
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
vishal
Top achievements
Rank 1
answered on 27 Sep 2010, 03:04 PM
hi rumen
its working fine here.
is der any option i can set the zindex of spell checker. because zindex of my radeditor is more than spell checker so spell checker goes behind of editor.
0
Rumen
Telerik team
answered on 27 Sep 2010, 03:25 PM
Hi Vishal,

You can control the z-index of RadSpell dialog (default skin) using the CSS class below:

<style type="text/css">
        .RadWindow.RadWindow_Default.rwNormalWindow.rwTransparentWindow
        {
            z-index: 30000 !important;
        }
</style>


All the best,
Rumen
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
vishal
Top achievements
Rank 1
answered on 09 Oct 2010, 12:46 PM
hi Rumen,
is there any way i can put my classes in radeditor styles drop down, i want to apply some of my classes to the text in rad editor.
thanks in advance,
0
Rumen
Telerik team
answered on 11 Oct 2010, 01:08 PM
Hi Vishal,

Yes, it is possible by loading the classes through the CssFiles property. See this article for more information: External CSS Files.

Best regards,
Rumen
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
vishal
Top achievements
Rank 1
answered on 11 Oct 2010, 01:14 PM
thanks Rumen,
is this possible using javascipt code. i am not using any css. i want to populate that using javascript.
0
Rumen
Telerik team
answered on 11 Oct 2010, 04:35 PM
Hi Vishal,

The Apply Class dropdown could be populated only from the CSS classes that reside on the page or from the CSS classes specified in an external file loaded through the CssFiles property.

Kind regards,
Rumen
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
vishal
Top achievements
Rank 1
answered on 11 Oct 2010, 04:39 PM
hi Rumen,
From the link you provided by you i learned that this can be possible in css by adding the code given below:

 RadEditor2.CssClasses.Clear();
 RadEditor2.CssClasses.Add("Links Class", "a.link");
 RadEditor2.CssClasses.Add("Images Class", ".img");

but it is not showing following classes in my drop down
correct me if anything is wrong.
0
Rumen
Telerik team
answered on 11 Oct 2010, 04:50 PM
Hi Vishal,

The CssClasses collection is used to restrict the available classes in the ApplyClass dropdown, but not to add new ones. The existing classes in the dropdown are populated only from the CSS classes that reside on the page with RadEditor or from the CSS classes specified in an external file loaded through the CssFiles property.


Kind regards,
Rumen
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
vishal
Top achievements
Rank 1
answered on 12 Oct 2010, 06:00 PM
hey Rumen,
is there any way i can map style like
<link href="somecss.css"> and then can use that in radeditor
i want to generate some dynamic css clases and thats very important to me.
i dont have css file for that classes.
so please suggest me the way how i can get that.
0
Harbinder Khera
Top achievements
Rank 1
answered on 13 Oct 2010, 04:33 PM
hi Rumen,
is there any way where i can restrict radeditor to show classes from one css file.
i just want to use classes of current page and dont want to use classes of css i am using.
there are lot of classes in that css file. so cant restrict add all of them using cssclass attribute.
0
Rumen
Telerik team
answered on 13 Oct 2010, 04:38 PM
Hi Harbinder,

Yes, you can populate only the desired classes in the Apply Class dropdown by setting the CssClasses collection. See this article: Css Styles.

Best wishes,
Rumen
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
Editor
Asked by
vishal
Top achievements
Rank 1
Answers by
Rumen
Telerik team
vishal
Top achievements
Rank 1
Harbinder Khera
Top achievements
Rank 1
Share this question
or