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

[Solved] Fixing the FormatBlock

0 Answers 55 Views
Editor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gordon
Top achievements
Rank 1
Gordon asked on 02 Dec 2010, 02:41 PM
I'm trying to get the text out of the radEditor to fill a textarea.

The first issue is that the .value() method returns me the html (can get around with jquery.text()).
The second issue is that the html that is being returned to me isn't paragraph formatted.  it's just plain, so i'm losing any line breaks in the text when  i use the jquery .text() function.  The behaviour of the telerik mvc demo is different, but i can't see why.

            <% Html.Telerik().Editor().Name("Description").Value(Model.Description).Tools(Sub(tools)
 
tools.clear()
tools.Bold().Italic().Underline().Strikethrough()
tools.Separator()
tools.InsertOrderedList().InsertUnorderedList()
tools.Separator()
tools.CreateLink().Unlink()
tools.FormatBlock(Sub(formats)
                    formats.Add("Paragraph", "p")
                  End Sub)
End Sub).Render()%>


var radEditor = $(this).find('table').data('tEditor');
var radHtml = radEditor.value();
var radText = $(radHtml).text();
          
alert(radHtml);
alert(radText);

Is there a way of fixing the formatblock to ensure all text is <p> wrapped?
Is there a telerik method for getting the text (not html), or should i keep going with the jquery text method?
Tags
Editor
Asked by
Gordon
Top achievements
Rank 1
Share this question
or