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

A few questions

5 Answers 78 Views
Editor
This is a migrated thread and some comments may be shown as answers.
tasos
Top achievements
Rank 1
tasos asked on 09 Jun 2010, 10:23 AM
Hello again.I would like to ask the following
a) I have inserted an asp.net page(the editor) inside an iframe.The problem is in IE7,8.
When i load my page(which includes the editor) ,the whole page is scrolled down to the editor(something like focus).
This doesn't happen in firefox and chrome.This is an important problem for me.
b)Can i create snippets by using javascript?
c)I have created a few custom buttons.When i press one custom button and i call a js function which opens a new window then,the window is opened but it lost focus.
My main page is focused.
d)I'm using something like this
function OnClientLoad(editor, args) {

            var style = editor.get_contentArea().style;
            editor.get_contentArea().style.cssText = "font-family:Tahoma,Serif !important;font-size:18px !important;background-color:#ff0000";
....
My question is,why the font family is not selected in the editor's drop down?The font size works!
e)Is it possible to call whatever is called when the InsertImage button is pressed,from my own custom button?

Sorry for so much questions but i try to see if i can customise it ,as i wish,in order to buy the product.
Thank you.
ps:I have noticed the following.When i use firefox and i insert visually a table i can't escape from it.
Moreover in many cases i don't see the caret(in firefox again).Are you aware of these problems?

5 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 14 Jun 2010, 01:37 PM
Hi Tasos,

I hope that you like RadEditor and you will become our customer.

Straight to the points:
1) What the editor actually does is similar to (but not exactly the same as) getting the focus. The editor just gets the page selection in order to attach its event handlers properly.
Here is an example how to set the focus to a textbox control when the page is loaded:

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<telerik:radeditor runat="server" OnClientLoad="OnClientLoad" ID="RadEditor1"></telerik:radeditor>
<script type="text/javascript">
function OnClientLoad(editor, args)
{
    setTimeout(function()
    {
        $get("TextBox1").focus();
    }, 100);
}
</script>

You can use this solution to set the focus on the desired element on the page.

2) You can paste content in RadEditor using the pasteHtml function. You can set content and replace the existing one by the set_html method. You can implement your own custom tool that will supply content to one of both methods and paste / set it in the content area.

3) My suggestion is to implement a custom RadEditor dialog, because when you click outside of RadEditor's content area the selection is lost. The RadEditor's custom dialog stores the cursor position and when closed restores the cursor and pastes the returned content on cursor position. You can test the following live demo: Custom Dialogs and see this yourself.

More information about custom dialogs is available in this help article: Add Custom Dialogs.

4) The RadEditor dropdowns' headers display information of the current selection returned by the browser's queryCommandValue method. I tested the provided code and noticed that IE passes information to the FontSize dropdown and it shows Verdana, but in Firefox the browser does not send information about the font family and for this reason the header is not updated. This is an entirely browser controlled behavior.

5) You can use the Image Manager as a standalone control and open it from a custom button. See this KB article for more information: Using the Image and Document managers outside RadEditor.

6) The content area of RadEditor is an editable IFRAME element that uses the rich text editing engine of the browser in which it operates. The observed behavior is limitation in Firefox and it can be observed in the attached HTML page having a standard editable IFRAME in it.

My suggestion is to use the workarounds that you have found so far or add more content before or after the table tag in Html mode and after that switch back to Design mode. You can also use the Real Time Html View module to edit the HTML content.

7) This is a browser bug (a regression) introduced in Firefox 3.6. We found that this issue is logged in this BugZilla report: focus() to an iframe in designmode renders cursor (caret) invisible in FF3.6 only.

Hopefully, it will be fixed by the browser developers soon.


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
tasos
Top achievements
Rank 1
answered on 14 Jun 2010, 02:55 PM
1) This is not ok because in my case you can clearly see that it's scrolled and then going up(scrolled again) again.
Even by using 100ms. Anyway i have found a solution.
2)I just wanted to add options under the snippet menu.This can be done programmatically in server side,but i need something in client's side.
Thank you for replying.
0
Rumen
Telerik team
answered on 15 Jun 2010, 12:25 PM
Hi Tasos,

1) I am glad that you found a solution for the problem.

2) The Insert Snippet dropdown could not be customized on the client, because it is populated with items on the server.
If you would like you can add your own Select dropdown to RadEditor toolbar and populate it with items on the client. You can see how to add RadCombobox to the editor's toolbar in this forum thread: Can I add a combobox to radeditor's tools collection?.

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
tasos
Top achievements
Rank 1
answered on 15 Jun 2010, 02:56 PM
Hello and thanks for replying.
What about the simple add image button which opens a pop up and you can insert a url(not the file manager). (<tool name="InsertImage" />)
Can i call(whatever it calls) it via a custom button of mine?

0
Rumen
Telerik team
answered on 15 Jun 2010, 03:21 PM
Hi tasos,

You can fire the InsertImage dialog through an external button using the code below:

<telerik:radeditor runat="server" ID="RadEditor1">
    <Tools>
        <telerik:EditorToolGroup>
            <telerik:EditorTool Name="InsertImage" />
        </telerik:EditorToolGroup>
    </Tools>
</telerik:radeditor>
<input type="button" value="InsertImage" onclick="ShowInsertImage();return false;" />
<script type="text/javascript">
    function ShowInsertImage() {
        var editor = $find("<%=RadEditor1.ClientID %>");
        editor.fire("InsertImage");
    }
</script>


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.
Tags
Editor
Asked by
tasos
Top achievements
Rank 1
Answers by
Rumen
Telerik team
tasos
Top achievements
Rank 1
Share this question
or