Originally Posted by
Daniil
Hi @ATLAS,
It appears to be possible to scroll without AutoScroll setting. Tested with FireFox.
Example
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Panel
ID="Panel1"
runat="server"
Width="400"
Height="400">
<Items>
<ext:Container runat="server" Height="500" Layout="VBoxLayout">
<Items>
<ext:Component runat="server" Flex="1" />
<ext:Label runat="server" Text="Bottom" />
</Items>
</ext:Container>
</Items>
</ext:Panel>
<ext:Button runat="server" Text="Scroll" Handler="App.Panel1.body.scrollBy(0, 100, true);" />
</form>
</body>
</html>
I have checked my site in Chrome, Firefox and IE(10) and there is still an issue. He is the code of my panel :-
@(Html.X().Container()
.Layout(LayoutType.HBox)
.LayoutConfig(new HBoxLayoutConfig { Align = HBoxAlign.StretchMax })
.Items(
Html.X().Panel()
.Border(false)
.Region(Region.West)
.Width(30)
.Collapsible(false)
.Split(false)
.MinWidth(30)
.MaxWidth(30)
.Height(110)
.Layout(LayoutType.VBox)
.LayoutConfig( new VBoxLayoutConfig { Align = VBoxAlign.Center, Pack = BoxPack.Center } )
.Items(
Html.X().ImageButton()
.ImageUrl(@Url.Content("~/Content/CommonImages/32x32/Up/Carousel_Left_Grey.png"))
.OverImageUrl(@Url.Content("~/Content/CommonImages/32x32/Over/Carousel_Left_Grey.png"))
.DisabledImageUrl(@Url.Content("~/Content/CommonImages/32x32/Disabled/Carousel_Left_Grey.png"))
.PressedImageUrl(@Url.Content("~/Content/CommonImages/32x32/Down/Carousel_Left_Grey.png"))
.Listeners(ev => ev.Click.Handler = "Ext.getCmp('" + @carouselId + "').scrollBy(205, 0, true);" )
),
Html.X().Panel()
.ID(@carouselId)
.Region(Region.Center)
.Border(false)
.Layout(LayoutType.HBox)
.Flex(1)
.AutoScroll(true)
.Defaults(Html.X().Parameter().Name("margins").Value("0 10 0 0").Mode(ParameterMode.Value))
.LayoutConfig(new HBoxLayoutConfig { Align = HBoxAlign.StretchMax, Pack = BoxPack.Center })
.Items(panels =>
{
for (int i = 0; i < 10; i++)
{
panels.Add(new FormPanel
{
Title = "FormPanel_" + Convert.ToString(i),
Width = 200,
Height = 110,
Cls = "carousel-form-panel",
HeaderPosition = Direction.Bottom,
Layout = "Fit",
Items =
{
new Image
{
ImageUrl = @Url.Content("~/Content/CommonImages/CarouselHome.png"),
Width = 196,
Height = 96
}
}
});
}
}),
Html.X().Panel()
.Border(false)
.Region(Region.East)
.Width(30)
.Collapsible(false)
.Split(false)
.MinWidth(30)
.MaxWidth(30)
.Height(110)
.Layout(LayoutType.VBox)
.LayoutConfig( new VBoxLayoutConfig { Align = VBoxAlign.Center, Pack = BoxPack.Center } )
.Items(
Html.X().ImageButton()
.ImageUrl(@Url.Content("~/Content/CommonImages/32x32/Up/Carousel_Right_Grey.png"))
.OverImageUrl(@Url.Content("~/Content/CommonImages/32x32/Over/Carousel_Right_Grey.png"))
.DisabledImageUrl(@Url.Content("~/Content/CommonImages/32x32/Disabled/Carousel_Right_Grey.png"))
.PressedImageUrl(@Url.Content("~/Content/CommonImages/32x32/Down/Carousel_Right_Grey.png"))
.Listeners(ev => ev.Click.Handler = "Ext.getCmp('" + @carouselId + "').scrollBy(-205, 0, true);" )
)
)
)
If I have AutoScroll = true, using scrollBy() works in Firefox, Chrome and IE (but will automatically insert a scroll bar, which I don't want). If I set AutoScroll = false then using scrollBy() does not work in any of the above browsers.