$0Hi$0$0$0$0$0I’m trying to implement a Custom Image Manager for the Editor. I have seen different examples to implement this, unfortunately I don't have the a .AddDialogDefinition() function on my editor! o_O $0$0I just updated to the newest version (2008.2.1001.35), are the examples (http://www.telerik.com/help/aspnet-ajax/addcustomdialogs.html) out of date?$0$0$0$0$0Thank you$0$0$0$0
4 Answers, 1 is accepted
0
Accepted
Hello Studach,
The recommended way to create a custom dialog is using the new showExternalDialog method which does not require the usage of the AddDialogDefinition method and DialogDefinition. You can find information about this method in the http://www.telerik.com/help/aspnet-ajax/addcustomdialogs.html help article.
By the way the AddDialogDefinition method is not removed from the server side api of RadEditor and you can verify that it works as expected by testing the following live example: Custom Dialogs. The AddDialogDefinition method is only not listed by the VS intellisense.
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
The recommended way to create a custom dialog is using the new showExternalDialog method which does not require the usage of the AddDialogDefinition method and DialogDefinition. You can find information about this method in the http://www.telerik.com/help/aspnet-ajax/addcustomdialogs.html help article.
By the way the AddDialogDefinition method is not removed from the server side api of RadEditor and you can verify that it works as expected by testing the following live example: Custom Dialogs. The AddDialogDefinition method is only not listed by the VS intellisense.
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Softec
Top achievements
Rank 1
answered on 06 Oct 2008, 11:16 AM
Thank you!
Another question, how can I change the Icon for my custom dialog? The style Tag doesn't seem to work. My tool name is InsertPicture, so the CSS style should be .rade_toolbar.Default .InsertPicture shouldn't it?
And is there a property to disable the resizing of images in the editor? I couldn't find anything in the help about it.
Thanks!
0
Accepted
Hi Studach,
Which skin is using the editor in your project?
If it is the Default one use the following syntax:
.rade_toolbar.<skinName> .<commandName>
{
background-image: url(MyImage.gif);
}
If it is another one then set !important after the value of the backround-image property:
.rade_toolbar.<skinName> .<commandName>
{
background-image: url(MyImage.gif) !important;
}
You can disable the image resize by setting unselectable="on" to the selected image:
<script type="text/javascript">
function OnClientLoad(editor, args)
{
editor.attachEventHandler("oncontrolselect", function()
{
//Check if image
window.setTimeout(function()
{
var selElem = editor.getSelection().getParentElement();
if (selElem.tagName == "IMG")
{
selElem.setAttribute("unselectable","on");
}
}, 100);
});
}
</script>
<telerik:radeditor id="RadEditor1" OnClientLoad="OnClientLoad" runat="server">
<Content>
<IMG SRC="Deisy.jpg" />
</Content>
</telerik:radeditor>
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Which skin is using the editor in your project?
If it is the Default one use the following syntax:
.rade_toolbar.<skinName> .<commandName>
{
background-image: url(MyImage.gif);
}
If it is another one then set !important after the value of the backround-image property:
.rade_toolbar.<skinName> .<commandName>
{
background-image: url(MyImage.gif) !important;
}
You can disable the image resize by setting unselectable="on" to the selected image:
<script type="text/javascript">
function OnClientLoad(editor, args)
{
editor.attachEventHandler("oncontrolselect", function()
{
//Check if image
window.setTimeout(function()
{
var selElem = editor.getSelection().getParentElement();
if (selElem.tagName == "IMG")
{
selElem.setAttribute("unselectable","on");
}
}, 100);
});
}
</script>
<telerik:radeditor id="RadEditor1" OnClientLoad="OnClientLoad" runat="server">
<Content>
<IMG SRC="Deisy.jpg" />
</Content>
</telerik:radeditor>
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Softec
Top achievements
Rank 1
answered on 06 Oct 2008, 01:12 PM
Thx!
Everthing works fine now!