PDA

View Full Version : [CLOSED] I can not get scroll for HtmlEditor



waxby
Jan 18, 2014, 4:14 PM
Hi

I can not get the scroll for htmleditor.. I have tried to add in a panel with autoscroll=true, and in this example I have put it in a container.
For the gridpanel in this example, the scroll works fine when needed. But not for the htmleditor.
(I striped down the code to hopefully make it more clear)

I guess it is a easy misstake I made, but I can just not find it :)

Best regards
Micael




<Window>
<ext:Window ID="win_uc_cases" runat="server"
IconCls="x-mss-inbox-small"
Width="1000"
Height="700"
Layout="Border" Maximizable="true" Minimizable="true" Closable="false"

Title="MSS Inbox" LazyMode="Instance" Modal="false">
<TopBar>
<ext:Toolbar ID="Toolbar1" runat="server">
<Items>

</Items>
</ext:Toolbar>
</TopBar>

<Items>
<ext:TreePanel
ID="treeCaseFilter"
runat="server"
Title="Case Filters"
Icon="BrickMagnify"
Height="300"
Width="170"
UseArrows="true"
AutoScroll="true"
Animate="true"
RootVisible="false"
Region="West">

</ext:TreePanel>


<ext:GridPanel ID="GridPanel1" runat="server"
Border="false" Region="Center" Split="true" AutoScroll="true" SelectionMemory="false" >
</ext:GridPanel>

<ext:Container ID="Container1" runat="server" Layout="AnchorLayout" AutoScroll="true" Region="South" Split="true">
<Items>
<ext:HtmlEditor runat="server" ID="lblHtmlEditor" ItemID="lblHtmlEditor" Anchor="100% 100%" ReadOnly="false" ></ext:HtmlEditor>
</Items>
</ext:Container>


</Items>
</ext:Window>

Daniil
Jan 20, 2014, 4:24 AM
Hi @waxby,

A vertical scrollbar appears for me when I type some amount of lines therein.

7513

So, I don't understand the problem. Please elaborate.

waxby
Jan 20, 2014, 3:10 PM
Hi Daniil
What I noticed now is that before I select anything in the Gridview, I have an editable htmleditor, and when typing text, scroll appears like you tested.
However, when selecting a row in the gridview, I do the folloing in codebehind:

lblHtmlEditor.Html = "<br/><br/>" + sTheHtmlBodyToShow;





... and no scroll appears, and it seem like it goes to readyonly mode.

Daniil
Jan 21, 2014, 2:42 AM
Also, please replace

lblHtmlEditor.Html = "html";
with

lblHtmlEditor.SetValue("html");

Also please set Height or Flex setting for the Container1. The south region requires either of those settings, see "Notes" here:
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.layout.container.Border

waxby
Jan 21, 2014, 3:16 PM
Hi!
.SetValue() was the trick. It works as supposed. However I do not understand why .html = "html" does not work.

Case closed :)

Best regards
Micael

Daniil
Jan 22, 2014, 3:18 AM
You can use the Text property as well.

lblHtmlEditor.Text = "html";

An HtmlEditor is a field. Like a TextField. You don't use a TextField's Html. The same policy for an HtmlEditor.

The Html property is for another purposes and, generally speaking, should not be used for fields.