MVC helper does not apply LayoutConfig for stretching

  1. #1

    MVC helper does not apply LayoutConfig for stretching

    Hi,

    I tried to create a Panel or Window with HBox layout with alignment type Stretch, but child items are not strecthed to the container window height. MVC helper does not add required align:stretch config property to generated javascript code:

    @(Html.X().Window()
          .Title("MVC HBox Layout")
          .Height(300)
          .Width(400)
          .Layout(LayoutType.HBox)
          .LayoutConfig(lc=> new HBoxLayoutConfig { Align = HBoxAlign.Stretch })
          .Items(b =>
                      {
                          b.Add(Html.X().Panel().Html("Panel1").Flex(1));
                          b.Add(Html.X().Panel().Html("Panel2").Flex(2));
                      }
                )          
      )
    Same bug exists for VBox layout:

    @(Html.X().Window()
          .Title("MVC VBox Layout")
          .Height(300)
          .Width(400)
          .Layout(LayoutType.VBox)
          .LayoutConfig(lc=> new VBoxLayoutConfig { Align = VBoxAlign.Stretch })
          .Items(b =>
                      {
                          b.Add(Html.X().Panel().Html("Panel1").Flex(1));
                          b.Add(Html.X().Panel().Html("Panel2").Flex(2));
                      }
                )
         )
    I tested with Ext.NET.MVC v2.1.1
    Last edited by Daniil; Feb 20, 2013 at 3:40 AM.
  2. #2
    Hi @bilbey,

    I think it should be.
    .LayoutConfig(lc => lc.Add(new VBoxLayoutConfig() { Align = VBoxAlign.Stretch }))
    Or (not sure it is available in v2.1)
    .LayoutConfig(new VBoxLayoutConfig() { Align = VBoxAlign.Stretch })
  3. #3
    Thanks Daniil,

    Both of your suggestions work!

Similar Threads

  1. Stretching a Portal
    By Patrick_G in forum 2.x Help
    Replies: 2
    Last Post: Jul 16, 2012, 9:39 PM
  2. Replies: 3
    Last Post: Feb 21, 2012, 7:46 AM
  3. Stretching desktop wallpaper
    By feanor91 in forum 1.x Help
    Replies: 0
    Last Post: Jan 19, 2012, 10:15 AM
  4. [CLOSED] generate dynamically LayoutConfig to a Panel
    By rnfigueira in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 26, 2011, 4:14 PM
  5. [CLOSED] [1.0] EditableGrid Apply to selection apply to all
    By ashton.lamont in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 24, 2010, 5:49 PM

Tags for this Thread

Posting Permissions