|
Adding Custom Dialogs
RadEditor provides a flexible mechanism for adding custom dialogs that
plug directly into the undo/redo mechanism and have the RadEditor look
and feel. In addition, the editor provides the developer with the ability to
specify arguments to be passed to the custom dialog (this functionality is
useful in scenarios, in which the dialog content should depend on the logged
user).
The steps to implement a custom dialog are:
1. Add a custom tool in the ToolsFile or using the editor's API.
2. Provide a command with the same name in the editor's global commands array,
which will call the ShowDialog method, provided by the RadEditor.
3. Supply all necessary parameter to the ShowDialog method (URL,
custom arguments, width, height, callback function, callback arguments, and
title).
4. Implement a callback function that will be called when the user closes the
custom dialog.
This example demonstrates how to add two custom dialogs to RadEditor:
1. Custom Image Management dialog to RadEditor.
2. A simple custom dialog
The Custom Image Managment dialog allows end-users to upload images on the
server, where they are stored in a database rather than the file system. Users
can also browse the image database using a grid-like view with thumbnails, and
insert images into the RadEditor content area.
The actual image is retrieved from the database by an aspx page, named
ShowImage.
|