Results 1 to 3 of 3

Thread: VBox Padding?

  1. #1

    Default VBox Padding?

    I am perplexed by the behavior (or lack thereof) of the VBox padding config. The documentation says

    padding : String
    Sets the padding to be applied to all child items managed by this layout.

    However, for me the value does not appear to do anything. See https://fiddle.sencha.com/#view/editor&fiddle/2u3j. In that example the padding value does not appear to have any effect at all. I would have hoped that it would do what Post 5 does and pad around its children (which from the Child perspective is its margin). Now the documentation could be taken to imply that it actually sets the padding value in the child like in Post 4, but it doesn't do that either. And since you don't see a white or red border around everything you can see that it clearly doesn't put the padding around the collection of children or around itself either. And to help drive the point home, commenting out the padding config does not have any visible effect on the results.

    So, I must be doing something wrong. Can someone tell me what?

    Thanks,
    Malcolm

  2. #2
    Sencha MVP Team Member
    Join Date
    Sep 2016
    Location
    Kennewick, WA
    Posts
    153
    Answers
    15

    Default

    Your fiddle


    The reason yours is not working is because "padding" is not an attribute of the layout: 'vbox' or any other type of layout. Padding is an attribute of a container object and needs to be applied there.

    Working fiddle


    Read the notes I added to the working fiddle as it explains a little more on setting padding and what objects it can be set on.

  3. #3

    Default

    Thanks. I guess I was just confused by the https://docs.sencha.com/extjs/6.7.0/...ainer.VBox.htm documenation. The "align" and "pack" configs shown there are included in the layout block in examples like https://examples.sencha.com/extjs/6....t-vertical-box, so I assumed that the "padding" config described there would be as well.

    Anyway, the padding around the entire set of children behavior, which putting the padding on the container does, isn't really what I wanted anyway. I have achieved my desired results by adding appropriate margins to all of my child containers. Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •