在Rad-Editor中设置内容时,它会在编辑器底部显示额外的空格。 我试过使用this。但解决方案不起作用。
<telerik:RadEditor
ClientIDMode="Static"
ID="objRadEditor"
AutoResizeHeight="true"
EnableResize="false"
EditModes="Design,Html"
runat="server"
StripFormattingOptions="all"
Width="100%" Height="140px"
ToolsFile="~/xml/RadEditorBasicToolsFile.xml">
<ContextMenus>
<telerik:EditorContextMenu Enabled="false" TagName="A">
</telerik:EditorContextMenu>
</ContextMenus>
</telerik:RadEditor>
如果您有解决方案,请提前致谢。
答案 0 :(得分:1)
您错过了活动&#34; OnClientLoad&#34;
<telerik:RadEditor
ClientIDMode="Static"
ID="objRadEditor"
AutoResizeHeight="true"
EnableResize="false"
EditModes="Design,Html"
runat="server"
StripFormattingOptions="all"
Width="100%" Height="140px"
OnClientLoad="RadEditorOnClientLoad"
ToolsFile="~/xml/RadEditorBasicToolsFile.xml">
<ContextMenus>
<telerik:EditorContextMenu Enabled="false" TagName="A">
</telerik:EditorContextMenu>
</ContextMenus>
</telerik:RadEditor>
<script type="text/javascript">
function RadEditorOnClientLoad(sender, args){
var editroWrap = document.getElementById(sender.get_id()),
children = [].slice.call(editroWrap.childNodes);
for (var i = 0, l = children.length; i < l; i++)
{
var child = children[i];
if (child.nodeType == Node.TEXT_NODE)
{
editroWrap.removeChild(child);
}
}
}
</script>