API Docs for: 0.0.2
Show:

layout.LayoutSpec Class

Documentation of available layout options for Views without parent view. When a view is rendered directly on an HTML page without being child of another view, you can use these options to configure position and size. If not specified, defaults will be set to height:"matchParent",width:"matchParent".

Constructor

layout.LayoutSpec

(
  • config
)

Parameters:

Example:

new ludo.View({
    renderTo:document.body,
    layout:{
        above:'idOfOtherView',
        sameWidthAs:'idOfOtherView',
        height:100
    }

});

Attributes

above

String | View | HTMLElement

Align bottom edge of this view with top edge of referenced view or DOM element. Reference can be Javascript reference to a view, id of view, "parent" for parent view, Javascript reference to DOM node or id of DOM node.

Default: undefined

alignBottom

String | View | HTMLElement

Align bottom edge of this view with bottom edge of referenced view or DOM element

Default: undefined

alignLeft

String | View | HTMLElement

Align left edge of this view with left edge of referenced view or DOM element

Default: undefined

alignRight

String | View | HTMLElement

Align right edge of this view with right edge of referenced view or DOM element

Default: undefined

alignTop

String | View | HTMLElement

Align top edge of this view with top edge of referenced view or DOM element

Default: undefined

below

String | View | HTMLElement

Align top edge of this view with bottom edge of referenced view or DOM element.

Default: undefined

centerHorizontalIn

String | View | HTMLElement

Center horizontally inside this DOM element or View

Default: undefined

centerIn

String | View | HTMLElement

Center vertically and horizontally inside this DOM element or View

Default: undefined

centerVerticalIn

String | View | HTMLElement

Center vertically inside this DOM element or View

Default: undefined

left

Number

Set left position of view to this exact value

Default: undefined

leftOf

String | View | HTMLElement

Align right edge of this view with left edge of referenced view or DOM element

Default: undefined

offsetWidth

Number

Increase width with this number of pixels

Default: undefined

offsetWidth

Number

Increase height with this number of pixels

Default: undefined

offsetX

Number

When other alignments has been made, offset x coordinate with this value.

Default: undefined

offsetY

Number

When other alignments has been made, offset y coordinate with this value.

Default: undefined

rightOf

String | View | HTMLElement

Align left edge of this view with right edge of referenced view or DOM element

Default: undefined

Example:

rightOf:'idOfDiv' // id of <div> tag
rightOf:myView // Reference to view
rightOf:'myView' // id of View

sameHeightAs

String | View | HTMLElement

Set same height of this view as height of referenced view or DOM element

Default: undefined

sameWidthAs

String | View | HTMLElement

Set same width of this view as width of referenced view or DOM element

Default: undefined

top

Number

Set top position of view to this exact value

Default: undefined

width

String | Number

Height of view in number(pixels), percent, "matchParent" or "wrap"

Example:

     height:200
     height:'matchParent' // Same height as parent
     height:'wrap', // wrap children
     height:'40%'

width

String | Number

Width of view in number(pixels), percent, "matchParent" or "wrap"

Default: "matchParent"

Example:

     width:200
     width:'matchParent', // Same width as parent
     width:'wrap', // wrap children
     width:'40%'