May 24, 2012, 9:36 AM
[CLOSED] Portal scroll - code behind
I'm trying to load portal from code behind, here are loading methods I'm using:
It works fine, but I cannot scroll the portal.
If I create the same portal (using the shown configs) from markup, it scrolls correctly.
Where could be the problem?
Thank you very much.
Private Sub setHome(ByRef pnlContainer As Panel)
Dim portal As Ext.Net.Portal = buildPortal()
Dim col1 As PortalColumn = addPortalColumn(portal, 0.33)
Dim col2 As PortalColumn = addPortalColumn(portal, 0.33)
Dim col3 As PortalColumn = addPortalColumn(portal, 0.33)
Dim p_1 As Portlet = addPortlet(col1, "1", Icon.Email, "about:blank")
Dim p_2 As Portlet = addPortlet(col1, "2", Icon.Zoom, "about:blank")
Dim p_3 As Portlet = addPortlet(col1, "3", Icon.PageGo, "about:blank")
Dim p_4 As Portlet = addPortlet(col1, "4", Icon.Folder, "about:blank")
Dim p_5 As Portlet = addPortlet(col1, "5", Icon.Folder, "about:blank")
pnlContainer.Items.Add(portal)
End Sub
Public Function buildPortal() As Ext.Net.Portal
Dim portalCfg As New Portal.Config() With {.Layout = "column", _
.Border = "false", _
.BodyBorder = "false", _
.StyleSpec = "background:transparent;", _
.BodyStyle = "background:transparent;", _
.AutoScroll = "true", _
.BodyCssClass = "no-horizontal-scroll"}
portalCfg.LayoutConfig.Add(New ColumnLayoutConfig() With {.FitHeight = False})
Dim portal As New Portal(portalCfg)
Return portal
End Function
Public Function addPortalColumn(ByRef portal As Ext.Net.Portal, _
ByVal columnWidth As Double) As Ext.Net.PortalColumn
Dim col_Cfg As New PortalColumn.Config() With {.StyleSpec = "padding:10px 5px 10px 10px;", _
.ColumnWidth = columnWidth, _
.Layout = "Anchor"}
Dim col As New PortalColumn(col_Cfg)
portal.Items.Add(col)
Return col
End Function
Public Function addPortlet(ByRef portalColumn As Ext.Net.PortalColumn, _
ByVal title As String, _
ByVal icon As Object, _
ByVal url As String) As Ext.Net.Portlet
Dim pl1 As New Portlet(New Portlet.Config() With {.Frame = "true", _
.Title = title, _
.Height = "200", _
.Padding = "0"})
If IsNumeric(icon) Then
pl1.Icon = icon
Else
pl1.IconCls = icon
End If
pl1.AutoLoad.Url = url
pl1.AutoLoad.Scripts = True
pl1.AutoLoad.Mode = LoadMode.IFrame
pl1.AutoLoad.ShowMask = True
portalColumn.Add(pl1)
Return pl1
End Function
The portal created is added to a panel (with FitLayout).It works fine, but I cannot scroll the portal.
If I create the same portal (using the shown configs) from markup, it scrolls correctly.
Where could be the problem?
Thank you very much.
Last edited by Daniil; May 24, 2012 at 2:50 PM.
Reason: [CLOSED]