photonui.ListView Class
ListView container.
Constructor
photonui.ListView
()
Item Index
Methods
- __onClick
- __onContextMenu
- __onDragEnd
- __onDragEnter
- __onDragOver
- __onDragStart
- __onDrop
- __onItemClick
- __onLocaleChanged
- _addIdentifiersClasses
- _bindEvent
- _buildContainerHtml
- _buildHtml
- _buildItemsHtml
- _callCallbacks
- _empty
- _generateColumns
- _generatePlaceholderElement
- _getChildren
- _getItemByIndex
- _getItemFromNode
- _handleClick
- _moveItem
- _registerWEvents
- _renderColumn
- _renderItem
- _renderItemInner
- _selectItem
- _selectItemsTo
- _unbindEvent
- _unselectItem
- _updateProperties deprecated
- _visibilityChanged
- addClass
- destroy
- hide
- registerCallback
- removeCallback
- removeClass
- selectItems
- show
- unparent
- unselectAllItems
- unselectItems
Properties
- __callbacks
- __events
- __html
- absolutePosition
- allowShiftSelect
- columnElement
- columns
- containerElement
- contextMenu
- contextMenuName
- customWidgetFormater
- data
- dragAndDroppable
- html
- identifiers
- itemElement
- items
- layoutOptions
- multiSelectable
- multiSelectWithCtrl
- name
- offsetHeight
- offsetWidth
- parent
- parentName
- selectable
- selectedItems
- tooltip
- unselectOnOutsideClick
- visible
Methods
__onClick
-
event
Called when an element is clicked.
Parameters:
-
event
Objectthe click event
__onContextMenu
-
event
Parameters:
-
event
Object
__onDragEnter
-
event
Called when a dragged item enters into another element.
Parameters:
-
event
Object
__onDragOver
-
event
Called when a item is dragged (fix for firefox).
Parameters:
-
event
Object
__onDrop
-
event
Called when a item is dropped (fix for firefox).
Parameters:
-
event
Object
__onItemClick
-
event
-
item
Called when an item is clicked.
Parameters:
-
event
Objectthe click event
-
item
Itemthe clicked item
__onLocaleChanged
()
private
Called when the locale is changed.
_addIdentifiersClasses
-
node
-
suffix
Adds classes defined by the identifiers property to a given element, with a given suffix.
_bindEvent
-
id
-
element
-
evName
-
callback
-
[options]
Parameters:
_buildContainerHtml
()
private
Build the widget container HTML.
_buildHtml
()
private
Build the widget HTML.
_buildItemsHtml
()
private
Build the items list HTML.
_callCallbacks
-
wEvent
-
params
_empty
()
private
Destroy all children of the layout
_generateColumns
()
private
Generate the list of columns.
_generatePlaceholderElement
()
Element
private
Generates a placeholder item element.
Returns:
the placeholder item element
_getItemByIndex
-
index
Returns the item at a given index.
Parameters:
-
index
Number
Returns:
the item
_getItemFromNode
-
itemNode
Gets an item of the collection from a given item DOM element.
Parameters:
-
itemNode
Elementthe item DOM element
Returns:
the item
_handleClick
-
item
-
modifiers
Handle item click events.
_moveItem
-
itemIndex
-
destinationIndex
Moves the item at a givent index to another given index. Rebuilds the dataview.
_renderColumn
-
content
-
columnId
Renders a given column.
Parameters:
-
content
photonui.Widget | Stringthe content of the column
-
columnId
Stringthe identifier of the column
Returns:
the rendered column
_renderItem
-
item
Renders a given item.
Parameters:
-
item
Object
Returns:
the rendered item
_renderItemInner
-
itemNode
-
item
Renders all the columns of a given item.
Returns:
the rendered item
_selectItemsTo
-
item
Selects all items from the current selection to a given item.
Parameters:
-
item
Objectthe item
_updateProperties
-
properties
Parameters:
-
properties
ArrayThe properties to update.
_visibilityChanged
-
visibility
Parameters:
-
visibility
BooleanCurrent visibility state (otptional, defaut=this.visible)
addClass
-
className
Parameters:
-
className
StringThe class to add.
destroy
()
Destroy the widget.
hide
()
registerCallback
-
id
-
wEvent
-
callback
-
thisArg
removeClass
-
className
Parameters:
-
className
StringThe class to remove.
selectItems
-
indexes
Selects the item(s) at given indexes.
Parameters:
-
indexes
...Number | Number[]
show
()
unparent
()
unselectAllItems
()
private
Unselects all items.
unselectItems
-
indexes
Unselects the item(s) at given indexes.
Parameters:
-
indexes
...Number | Number[]
Properties
__events
Object
private
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"
contextMenuName
String
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
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"
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
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