API Docs for: 1.8.0
Show:

photonui.GridLayout Class

Extends photonui.Layout
Module: Layout
Parent Module: PhotonUI

Grid layout.

Layout Options:

{
     x: <Number, default: 0>,
     y: <Number, default: 0>,
     cols: <Number, default: 1>,
     rows: <Number, default: 1>,

     horizontalAlign: <String (stretch|expand, start|left, center, end|right), default: stretch>,
     verticalAlign: <String (stretch|expand, start|top, center|middle, end|bottom), default: stretch>,

     minWidth: <Number, default: null>,
     maxWidth: <Number, default: null>,
     width: <Number, default: null>,

     minHeight: <Number, default: null>,
     maxHeight: <Number, default: null>,
     height: <Number, default: null>,
}

Constructor

photonui.GridLayout

()

Methods

__onContextMenu

(
  • event
)
private
Called when the context menu should be displayed.

Parameters:

__onLocaleChanged

() private

Inherited from photonui.Widget but overwritten in src/layout/layout.js:273

Called when the locale is changed.

_bindEvent

(
  • id
  • element
  • evName
  • callback
  • [options]
)
private

Inherited from photonui.Base: src/base.js:229

Javascript event binding (for internal use).

Parameters:

  • id String
    An unique id for the event.
  • element DOMElement
    The element on which the event will be bind.
  • evName String
    The event name (e.g. "mousemove", "click",...).
  • callback Function
    The function that will be called when the event occured.
  • [options] Object optional
    options for addEventListener

_buildHtml

() private

Inherited from photonui.Widget but overwritten in src/layout/gridlayout.js:218

Build the widget HTML.

_callCallbacks

(
  • wEvent
  • params
)
private

Inherited from photonui.Base: src/base.js:292

Call all callbacks for the given wEvent. NOTE: the first argument passed to the callback is the current widget. NOTEĀ²: if the thisArg of the callback is null, this will be binded to the current widget.

Parameters:

  • wEvent String
    The widget event.
  • params Array
    Parametters that will be sent to the callbacks.

_computeLayoutOptions

(
  • widget
)
Object private

Returns a normalized layoutOption for a given widget.

Parameters:

Returns:

Object:

the layout options

_lockUpdate

() private
Lock the update of the layout.

_registerWEvents

(
  • wEvents
)
private

Inherited from photonui.Base: src/base.js:276

Register available wEvent.

Parameters:

_sizingHack

() private

Hack to get thing working with Gecko and Trident.

MSIE 11:

  • The hack fixes all the issues,

MSIE 10:

  • There is issues with rowspan
  • The dynamic resizing does not works

Firefox:

  • There is some minor issues with rowspan

_unbindEvent

(
  • id
)
private

Inherited from photonui.Base: src/base.js:257

Unbind javascript event.

Parameters:

  • id String
    The id of the event.

_updateLayout

() private

Inherited from photonui.Layout but overwritten in src/layout/gridlayout.js:235

Update the layout.

_updateProperties

(
  • properties
)
deprecated private

Inherited from photonui.Base: src/base.js:209

Force the update of the given properties. This method is deprecated. One should use '@photonui-update' abitbol's annotation on concerned properties.

Parameters:

  • properties Array
    The properties to update.

_updateSpacing

() private

Update the spacing between widgets

_visibilityChanged

(
  • visibility
)
private

Inherited from photonui.Widget but overwritten in src/layout/gridlayout.js:203

Called when the visibility changes.

Parameters:

  • visibility Boolean

    Current visibility state (otptional, defaut=this.visible)

addChild

(
  • widget
  • layoutOption
)
Add a widget to the layout.

Parameters:

  • widget photonui.Widget
    The widget to add.
  • layoutOption Object
    Specific option for the layout (optional).

addClass

(
  • className
)
Add a class to the outer HTML element of the widget.

Parameters:

  • className String
    The class to add.

destroy

()

Inherited from photonui.Base but overwritten in src/layout/layout.js:211

Destroy the widget.

empty

()
Destroy all children of the layout

hide

()
Hide the widget (equivalent to widget.visible = false).

registerCallback

(
  • id
  • wEvent
  • callback
  • thisArg
)

Inherited from photonui.Base: src/base.js:169

Register a callback for any PhotonUI/Widget event (called wEvent). Callback signature: function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]])

Parameters:

  • id String
    An unique id for the callback.
  • wEvent String
    the PhotonUI/Widget event name.
  • callback Function
    The callback function.
  • thisArg Object
    The value of this (optionnal, default = current widget).

removeCallback

(
  • id
)

Inherited from photonui.Base: src/base.js:193

Remove a registered callback.

Parameters:

  • id String
    The id of the callback.

removeChild

(
  • widget
)

Inherited from photonui.Container but overwritten in src/layout/layout.js:178

Remove a widget from the layout.

Parameters:

removeClass

(
  • className
)
Remove a class from the outer HTML element of the widget.

Parameters:

  • className String
    The class to remove.

show

()
Display the widget (equivalent to widget.visible = true).

unparent

()
Detache the widget from its parent.

Properties

__callbacks

Object private

Inherited from photonui.Base: src/base.js:142

Object containing references to registered callbacks.

__events

Object private

Inherited from photonui.Base: src/base.js:132

Object containing references javascript events binding (for widget internal use).

__html

Object private
Object containing references to the widget HTML elements

_updatingLayout

Boolean private

Flag to indicate that the layout is actually been updated.

Default: false

absolutePosition

Object
Absolute position of the widget on the page. {x: Number, y: Number}

child

photonui.Widget

The child widget.

Default: null (no child)

childName

String

The child widget name.

Default: null (no child)

children

Array
Layout children widgets.

Default: []

childrenNames

Array
Layout children widgets name.

Default: []

containerNode

HTMLElement

HTML Element that contain the child widget HTML.

contextMenu

photonui.PopupWindow
The managed contextual menu.

Default: null (= no context menu)

contextMenuName

String
The name of the managed contextual menu (photonui.PopupWindow().name).

Default: null (= no context menu)

data

Object

Inherited from photonui.Base: src/base.js:113

Arbitrary data

Default: {}

horizontalChildExpansion

Boolean

Horizontaly expand the container's child widget.

Default: true

horizontalPadding

Number

Horizontal padding (px).

Default: 0

horizontalSpacing

Number

The horizontal spacing between children widgets.

Default: 5

html

HTMLElement

Inherited from photonui.Widget but overwritten in src/layout/gridlayout.js:173

Html outer element of the widget (if any).

Default: null

layoutOptions

Object
Layout options.

Default: {}

name

String
The unique name of the widget.

Default: "widget-" + uuid.v4()

offsetHeight

Number
Widget height (outer HTML element).

offsetWidth

Number
Widget width (outer HTML element).

parent

photonui.Widget
The parent widget.

Default: null (no parent)

parentName

String
The parent widget name.

Default: null (no parent)

tooltip

String
Tooltip.

Default: null

verticalChildExpansion

Boolean

Verticaly expand the container's child widget.

Default: false

verticalPadding

Number

Vertical padding (px).

Default: 0

verticalSpacing

Number

The vertical spacing between children widgets.

Default: 5

visible

Boolean
Is the widget visible or hidden.

Default: true