Hi ,
I want to access a div inside the content of the editor. What i have done is given below.
<telerik:RadEditor runat="server" ID="RadEditor1">
<Tools>
<telerik:EditorToolGroup>
<telerik:EditorTool Name="DragAndDropContainer" Text="Drag and Drop a div" />
</telerik:EditorToolGroup>
</Tools>
<Content>
<div id="dragable1" style="position: relative; width: 50px; height: 50px; background: none repeat scroll 0% 0% silver;
border: 1px dashed red; left: 294px; top: 3px;" >
</div>
</Content>
</telerik:RadEditor>
<script type="text/javascript">
//<![CDATA[
Telerik.Web.UI.Editor.CommandList["DragAndDropContainer"] = function(commandName, editor, args)
{
if (editor.getSelectionHtml() != "")
{
editor.fire("FontSize", {value : "4"}); //fire the FontSize command
editor.fire("ForeColor", {value : "red"}); //fire the ForeColor command
}
else
{
DragHandler.attach(document.getElementById('dragable1'));
}
};
In this case document.getElementById('dragable1') returns null. Could anyone help how should i access this div.
Thanks,
Rashim
I want to access a div inside the content of the editor. What i have done is given below.
<telerik:RadEditor runat="server" ID="RadEditor1">
<Tools>
<telerik:EditorToolGroup>
<telerik:EditorTool Name="DragAndDropContainer" Text="Drag and Drop a div" />
</telerik:EditorToolGroup>
</Tools>
<Content>
<div id="dragable1" style="position: relative; width: 50px; height: 50px; background: none repeat scroll 0% 0% silver;
border: 1px dashed red; left: 294px; top: 3px;" >
</div>
</Content>
</telerik:RadEditor>
<script type="text/javascript">
//<![CDATA[
Telerik.Web.UI.Editor.CommandList["DragAndDropContainer"] = function(commandName, editor, args)
{
if (editor.getSelectionHtml() != "")
{
editor.fire("FontSize", {value : "4"}); //fire the FontSize command
editor.fire("ForeColor", {value : "red"}); //fire the ForeColor command
}
else
{
DragHandler.attach(document.getElementById('dragable1'));
}
};
In this case document.getElementById('dragable1') returns null. Could anyone help how should i access this div.
Thanks,
Rashim