Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resize ext.net container with border layout on browser window resize

Below is the markup i am using to render an EXT.NET container containing a collapsible panel(west) and another panel containing my content (center).

how do i make it resizable when i resize my browser?

currently its not resizing as i specified width and height and if i do not specify Width and Height, it does not show me anything, it shows blank.

    @Html.X().Container().Layout(LayoutType.Border).Width(500).Height(300).Items(
    Html.X().Panel()
                     .ID("Panel1")
                     .Region(Region.West)
                     .AutoDoLayout(true)
                     .Collapsible(true).Border(true).Title("West Panel").Items(
                     Html.X().Label().Text("Item 1"),
                     Html.X().Label().Text("Item 2")
                     ),
    Html.X().Panel().ID("Panel2").Region(Region.Center).Title("Center")
)

EDIT : I Cannot use ViewPort as its distracting my layout

like image 468
RobertKing Avatar asked Nov 09 '22 10:11

RobertKing


1 Answers

I am not ure container support this but viewport. Use instead of the container an viewport

@Html.X().Viewport().Layout(LayoutType.Border).Items(
        Html.X().Panel()
        .ID("Panel1")
                     .Region(Region.West)
                     .AutoDoLayout(true)
                     .Collapsible(true).Border(true).Title("West Panel").Items(
                     Html.X().Label().Text("Item 1"),
                     Html.X().Label().Text("Item 2")
                     ),
        Html.X().Panel().ID("Panel2").Region(Region.Center).Title("Center")
)

another solution I can imagine ,to get the resize event and set the width and height of container with the appropriate values

like image 165
sakir Avatar answered Nov 15 '22 11:11

sakir