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

[Solved] My Custom Button

5 Answers 158 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Tolga
Top achievements
Rank 1
Tolga asked on 04 Jun 2008, 02:29 PM
In mybtnpopup... 

5 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 04 Jun 2008, 02:47 PM
Hello Tolga,

Please, see the following live examples which could be helpful for your scenario:
Custom Tools and Custom Dialogs. They provide guidance how to add custom buttons and dialogs to the editor.

Sincerely,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Tolga
Top achievements
Rank 1
answered on 04 Jun 2008, 03:59 PM
Hello Rumen
I look
Custom Dialogs.
but I dont see 
using Telerik.Web.UI;
I have got using Telerik.WebControls....
but i dont find DialogDefinition
0
Rumen
Telerik team
answered on 05 Jun 2008, 08:14 AM
Hi Tolga,

You are using RadEditor for ASP.NET (Classic), but not RadEditor for ASP.NET AJAX.

Please, review the following examples
Adding Custom Tools,
Adding Custom Dialogs
and help articles
Adding Your Own Buttons,
Add Custom Dialogs

that apply to RadEditor Classic.

Regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Tolga
Top achievements
Rank 1
answered on 06 Jun 2008, 06:01 PM
Hello Rumen
I expore your links and c
Custom Dialog Example
I apply this example and put my costum button and copy jacascript and
when I click the button my custom aspx page is opening.
But I have got a button when i click this button , I want return value
my button task is import html when i click i run some process and evulate html and I ceate a Session[HtmlText] and fill value this html

But I cant do it. I open page i click buton but this dialog windows cant closed and cant fill radeditor
How I can return this text value in rad editor?
0
Rumen
Telerik team
answered on 10 Jun 2008, 10:46 AM
Hi Tolga,

You can examine the source code of the Custom dialogs which is avialable in the RadEditor / RadControls demo examples.

Locate and open the MyCustomDialog.html file and you will find the InsertLink function which is called when the user presses the Insert button of the custom dialog:

	<script language="javascript">
function insertLink()
{
var linkContainer = document.getElementById("linkContainer");
var returnValue =
{
url:linkContainer.options[linkContainer.selectedIndex].value,
text:linkContainer.options[linkContainer.selectedIndex].text
};
CloseDlg(returnValue);//close the dialog and return value to the page with the editor
}
</script>
In the InsertLink function you will find the CloseDlg function which is used to close the custom dialog and return some value (in our case the returnValue hash table) to the callback function of the ShowDialog method, e.g.

editor.ShowDialog(
                        "MyCustomDialog.html"
                        , null//argument
                        , 180
                        , 80
                        , CustomDialogCallback
                        , null
                        , "Custom Dialog");
                };

                function CustomDialogCallback(returnValue)
                {
                    alert("This function is called when the dialog is closed");
                    if (returnValue)
                    {
                        RadEditor1ClientObject.PasteHtml("<a href=\"" + returnValue.url + "\">" + returnValue.text + "</a>");
                    }
                }


Let me know if you experience any other problems.

Greetings,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
Tolga
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Tolga
Top achievements
Rank 1
Share this question
or