API Docs for: 1.8.0
Show:

photonui.TableView Class

Module: DataView
Parent Module: PhotonUI

TableView container.

Constructor

photonui.TableView

()

Methods

__onClick

(
  • event
)
private

Called when an element is clicked.

Parameters:

  • event Object

    the click event

__onContextMenu

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

Parameters:

__onDragEnd

(
  • event
)
private

Called when a item drag has ended.

Parameters:

__onDragEnter

(
  • event
)
private

Called when a dragged item enters into another element.

Parameters:

__onDragOver

(
  • event
)
private

Called when a item is dragged (fix for firefox).

Parameters:

__onDragStart

(
  • event
)
private

Called when an item is dragged.

Parameters:

__onDrop

(
  • event
)
private

Called when a item is dropped (fix for firefox).

Parameters:

__onItemClick

(
  • event
  • item
)
private

Called when an item is clicked.

Parameters:

  • event Object

    the click event

  • item Item

    the clicked item

__onLocaleChanged

() private

Inherited from photonui.Widget but overwritten in src/dataview/dataview.js:1032

Called when the locale is changed.

_addIdentifiersClasses

(
  • node
  • suffix
)
private

Adds classes defined by the identifiers property to a given element, with a given suffix.

Parameters:

_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

_buildContainerHtml

() private

Build the widget container HTML.

_buildHtml

() private

Inherited from photonui.Widget but overwritten in src/dataview/dataview.js:495

Build the widget HTML.

_buildItemsHtml

() private

Inherited from photonui.DataView but overwritten in src/dataview/tableview.js:85

Build the items list 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.

_empty

() private

Destroy all children of the layout

_generateColumns

() private

Generate the list of columns.

_generatePlaceholderElement

() Element private

Generates a placeholder item element.

Returns:

Element:

the placeholder item element

_getChildren

() Array private

Layout children widgets.

Returns:

Array:

the childen widget

_getItemByIndex

(
  • index
)
Object private

Returns the item at a given index.

Parameters:

Returns:

Object:

the item

_getItemFromNode

(
  • itemNode
)
Object private

Gets an item of the collection from a given item DOM element.

Parameters:

  • itemNode Element

    the item DOM element

Returns:

Object:

the item

_handleClick

(
  • item
  • modifiers
)
private

Handle item click events.

Parameters:

_moveItem

(
  • itemIndex
  • destinationIndex
)
private

Moves the item at a givent index to another given index. Rebuilds the dataview.

Parameters:

  • itemIndex Number

    the index of the item to move

  • destinationIndex Number

    the destination index

_registerWEvents

(
  • wEvents
)
private

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

Register available wEvent.

Parameters:

_renderColumn

(
  • content
  • columnId
)
Element private

Renders a given column.

Parameters:

Returns:

Element:

the rendered column

_renderHeader

() Element private

Renders the table header.

Returns:

Element:

the rendered header

_renderItem

(
  • item
)
Element private

Renders a given item.

Parameters:

Returns:

Element:

the rendered item

_renderItemInner

(
  • itemNode
  • item
)
Element private

Renders all the columns of a given item.

Parameters:

  • itemNode Element

    the container element of the item

  • item Object

    the rendered item

Returns:

Element:

the rendered item

_selectItem

(
  • item
)
private

Selects an item.

Parameters:

_selectItemsTo

(
  • item
)
private

Selects all items from the current selection to a given item.

Parameters:

_unbindEvent

(
  • id
)
private

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

Unbind javascript event.

Parameters:

  • id String
    The id of the event.

_unselectItem

(
  • item
)
private

Unselects an item.

Parameters:

_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.

_visibilityChanged

(
  • visibility
)
private
Called when the visibility changes.

Parameters:

  • visibility Boolean

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

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/dataview/dataview.js:388

Destroy the widget.

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.

removeClass

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

Parameters:

  • className String
    The class to remove.

selectItems

(
  • indexes
)

Selects the item(s) at given indexes.

Parameters:

show

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

unparent

()
Detache the widget from its parent.

unselectAllItems

() private

Unselects all items.

unselectItems

(
  • indexes
)

Unselects the item(s) at given indexes.

Parameters:

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

absolutePosition

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

allowShiftSelect

Boolean

If true, allow selecting multiple items with one click when pressing "shift" key. Only used when "multiSelectable" option is set to "true".

Default: true

columnElement

String

The type of the columns DOM elements which will be created during the render process.

Default: "span"

columns

Array

The list of columns which defines the structure of the items (if not setted manually, the columns are automatically generated).

Default: null

containerElement

String

The type of the container DOM element which will be created during the render process.

Default: "ul"

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)

customWidgetFormater

Function

A custom formater function which overrides the default rendering process of the widget.

Default: null

data

Object

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

Arbitrary data

Default: {}

dragAndDroppable

Boolean

Defines if the data items can be drag & dropped.

Default: false

html

HTMLElement

Inherited from photonui.Widget but overwritten in src/dataview/dataview.js:302

Html outer element of the widget (if any).

Default: null

identifiers

Array private

The list of identifiers wich will be added to every generated elements of the widget as classnames.

Default: []

itemElement

String

The type of the items DOM elements which will be created during the render process.

Default: "li"

items

Array

The collection of items displayed by the data view widget.

Default: null

layoutOptions

Object
Layout options.

Default: {}

multiSelectable

Boolean

Defines if the data items can be multi-selected. Only used when "selectable" option is set to "true".

Default: false

multiSelectWithCtrl

Boolean

Defines wether or not "ctrl" key has to be pressed to multi-select items. Only used when "multiSelectable" option is set to "true".

Default: true

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)

selectable

Boolean

Defines if the data items can be selected.

Default: false

selectedItems

Array

The currently selected items.

Default: []

showHeader

Boolean

Defines if the header is displayed.

Default: true

tooltip

String
Tooltip.

Default: null

unselectOnOutsideClick

Boolean

If true, clicking outside of the items (in the container) will unselect currently selected items. Only used when "selectable" option is set to "true".

Default: false

visible

Boolean
Is the widget visible or hidden.

Default: true