layout question

Hello,
The “margin” setting works, but the “padding” attribute of ViewLoader seems to be ignored or overridden by the loaded view when nest it like this:

VLayout

  isc.ViewLoader.create({
    ID: "myView",
    padding:20,
    margin:20,
    showEdges:true
  })
...
myView.setViewURL("foo.js");

The margin works, but the padding isn’t shown.

I’ve found some workarounds:

  • instead of padding the parent, adding margin to all the children (I’d like to avoid duplicate styles across everything I load)
  • using a Canvas in place of the ViewLoader, then adding the ViewLoader as a child of the Canvas, using margins of the ViewLoader (padding on the Canvas don’t seem to work here, either).

The second workaround is acceptable, but it requires several additional 100% height and width declarations and baggage code to do something that it seems like padding should do.

Any clues on why padding may not be rendering here?

Thanks

Hi JTinCA,

The padding attribute isn’t being overridden - CSS padding only affects content, not absolutely positioned children.

Typical practice here is to use the layoutMargin property of Layouts to create the equivalent of “padding-for-children”. This puts the setting in one place.

Will this work for you?

yes, that works, thanks.

Once a layout Margin is set. Is it possible to edit it from outside the object that set it??