Hi Geoff,
thanx for the link, the code works but I still have a problem, hope you can help with this.
My HtmlEditor has fixed height, masking the editor to make it ReadOnly masks also the scroll bar in case I have long text.
This is my code:
....
//after ScriptManager tag
<script type="text/javascript">
Ext.override(Ext.form.HtmlEditor, {
/**
* Set a readonly mask over the editor
* @param {Boolean} readOnly - True to set the read only property, False to switch to the editor
*/
setReadOnly: function(readOnly)
{
if (readOnly)
{
this.syncValue();
var roMask = this.wrap.mask();
roMask.dom.style.filter = "alpha(opacity=20);"; //IE
roMask.dom.style.opacity = "0.2"; //Mozilla
roMask.dom.style.background = "white";
roMask.dom.innerHTML = this.getValue();
roMask.dom.style.height = "300px";
roMask.dom.style.overflow = "scroll";
this.el.dom.readOnly = true;
}
else
{
if (this.rendered) this.wrap.unmask();
this.el.dom.readOnly = false;
}
}
});
</script>
then in the page
...
<ext:HtmlEditor ID="HtmlEditor2" Width="784px" Height="300px" ReadOnly="true" FieldLabel="Anteprima"
LabelStyle="padding-left:8px;font-weight:bold" EnableViewState="true" runat="server"
StyleSpec="margin:0px 0px 0px 4px;">
<Listeners>
<Render Handler="this.setReadOnly(true);" />
</Listeners>
</ext:HtmlEditor>
If you load long text inside editor, you'll see also scrollbar is disabled, I need it active.
Thanx
Matteo