API Docs for: 3.18.1

WidgetPosition Class

Widget extension, which can be used to add positioning support to the base Widget class, through the Base.build method.

Item Index

Methods

Properties

Attributes

Methods

move

(
  • x
  • [y]
)

Moves the Widget to the specified page xy co-ordinate position.

Parameters:

  • x Number | Number[]

    The new x position or [x, y] values passed as an array to support simple pass through of Node.getXY results

  • [y] Number optional

    The new y position

syncXY

()

Synchronizes the Panel's "xy", "x", and "y" properties with the Widget's position in the DOM.

Properties

ATTRS

Object static

Static property used to define the default attribute configuration introduced by WidgetPosition.

POSITIONED_CLASS_NAME

String static

Default class used to mark the boundingBox of a positioned widget.

Default: "yui-widget-positioned"

Attributes

x

Number

Page X co-ordinate for the widget. This attribute acts as a facade for the xy attribute. Changes in position can be monitored by listening for xyChange events.

Default: 0

Fires event xChange

Fires when the value for the configuration attribute x is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

xy

Array

Page XY co-ordinate pair for the widget.

Default: [0,0]

Fires event xyChange

Fires when the value for the configuration attribute xy is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

y

Number

Page Y co-ordinate for the widget. This attribute acts as a facade for the xy attribute. Changes in position can be monitored by listening for xyChange events.

Default: 0

Fires event yChange

Fires when the value for the configuration attribute y is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.