Zimlet JavaScript API Reference - DwtListView

Class DwtListView


Extends DwtComposite.

A list view presents a list of items as rows with fields (columns).

Defined in: DwtListView.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
DwtListView(params, parent, className, posStyle, headerList, noMaximize, view)
Creates a list view.
Method Summary
Method Attributes Method Name and Description
 
Adds an action listener.
 
addItem(item, index, skipNotify, itemIndex)
Adds a row for the given item to the list view.
 
addItems(itemArray)
Adds the items.
 
Adds a selection listener.
 
Adds a state change listener.
 
De-selects all items in the list.
 
Starts with an element and works its way up the element chain until it finds one with an ID that maps to an item, then returns the associated item.
 
Starts with an element and works its way up the element chain until it finds one with an ID that maps to an item.
 
Gets the index of the given item.
 
Gets the selected items.
 
Gets the selection count.
 
Gets the item associated with the given event.
 
Gets the item DIV associated with the given event.
 
Removes an action listener.
 
removeAll(skipNotify)
Removes all the items from the list.
 
removeItem(item, skipNotify, skipAlternation)
Removes a row for the given item to the list view.
 
Removes a selection listener.
 
Adds a state change listener.
 
Scrolls the list view up or down one page.
 
Selects all items in the list.
 
selectItem(selected, selected)
Selects or deselects a single item.
 
set(list, defaultColumnSort, noResultsOk)
Creates a list view out of the given vector of items.
 
setEnabled(enabled)
Sets the enabled flag.
 
setSize(width, height)
Sets the size of the view.
 
setUI(defaultColumnSort, noResultsOk)
Renders the list view using the current list of items.
 
size()
Gets the count of items in the list.
 
Use the list elements
    and
  • instead of div and table elements
Methods borrowed from class DwtComposite:
addChild, cleanupSeparators, clear, dispose, getChild, getChildren, getNumChildren, getTabGroupMember, removeChild, removeChildren
Methods borrowed from class DwtControl:
addClassName, addControlListener, addDisposeListener, addListener, appendElement, blur, clearContent, clearHandler, condClassName, delClassName, focus, getBounds, getClassName, getContent, getCursor, getData, getDragBox, getDragSource, getDropTarget, getEnabled, getFocusElement, getH, getHtmlElement, getHTMLElId, getInsetBounds, getInsets, getLocation, getMargins, getOpacity, getOuterSize, getPosition, getScrollContainer, getScrollStyle, getSize, getTooltipBase, getToolTipContent, getVisibility, getVisible, getW, getX, getXW, getY, getYH, getZIndex, hasFocus, isAlertShown, isDisposed, isInitialized, isListenerRegistered, notifyListeners, preventContextMenu, preventSelection, removeAllListeners, removeControlListener, removeDisposeListener, removeListener, reparent, reparentHtmlElement, replaceElement, setBounds, setClassName, setContent, setCursor, setData, setDisplay, setDisplayState, setDragBox, setDragSource, setDropTarget, setEventPropagation, setFocusElement, setHandler, setHtmlElementId, setLocation, setOpacity, setPosition, setScrollStyle, setToolTipContent, setVisibility, setVisible, setZIndex, showAlert, zShow
Class Detail
DwtListView(params, parent, className, posStyle, headerList, noMaximize, view)
Creates a list view.
Author: Parag Shah, Conrad Damon.
Parameters:
{hash} params
a hash of parameters
{DwtComposite} parent
the parent widget
{string} className
the CSS class
{constant} posStyle
the positioning style (see DwtControl)
{array} headerList
a list of IDs for columns
{boolean} noMaximize
if true, all columns are fixed-width (otherwise, one will expand to fill available space)
{constant} view
the ID of view
Method Detail
addActionListener(listener)
Adds an action listener.
Parameters:
{AjxListener} listener
the listener

addItem(item, index, skipNotify, itemIndex)
Adds a row for the given item to the list view.
Parameters:
{Object} item
the data item
{number} index
the index at which to add item to list and list view
{boolean} skipNotify
if true, do not notify listeners
{number} itemIndex
index at which to add item to list, if different from the one for the list view

addItems(itemArray)
Adds the items.
Parameters:
{array} itemArray
an array of items

addSelectionListener(listener)
Adds a selection listener.
Parameters:
{AjxListener} listener
the listener

addStateChangeListener(listener)
Adds a state change listener.
Parameters:
{AjxListener} listener
the listener

deselectAll()
De-selects all items in the list.

{Object} findItem(el)
Starts with an element and works its way up the element chain until it finds one with an ID that maps to an item, then returns the associated item.
Parameters:
{Element} el
element to start with
Returns:
{Object} the item

{Element} findItemDiv(el)
Starts with an element and works its way up the element chain until it finds one with an ID that maps to an item.
Parameters:
{Element} el
the element to start with
Returns:
{Element} the element

{number} getItemIndex(item)
Gets the index of the given item.
Parameters:
{Object} item
the item
Returns:
{number} the index or null if not found

{Array} getSelectedItems()
Gets the selected items.
Returns:
{Array} an array of selected items

{number} getSelectionCount()
Gets the selection count.
Returns:
{number} the selection count

{Object} getTargetItem(ev)
Gets the item associated with the given event. Starts with the event target and works its way up the element chain until it finds one with an ID that maps to an item.
Parameters:
{DwtEvent} ev
the event
Returns:
{Object} the item

{Object} getTargetItemDiv(ev)
Gets the item DIV associated with the given event. Starts with the event target and works its way up the element chain until it finds one with an ID that maps to an item.
Parameters:
{DwtEvent} ev
the event
Returns:
{Object} the item

removeActionListener(listener)
Removes an action listener.
Parameters:
{AjxListener} listener
the listener

removeAll(skipNotify)
Removes all the items from the list.
Parameters:
{boolean} skipNotify
if true, do not notify listeners

removeItem(item, skipNotify, skipAlternation)
Removes a row for the given item to the list view.
Parameters:
{Object} item
the data item
{boolean} skipNotify
if true, do not notify listeners
{boolean} skipAlternation
if true, do not fix alternation

removeSelectionListener(listener)
Removes a selection listener.
Parameters:
{AjxListener} listener
the listener

removeStateChangeListener(listener)
Adds a state change listener.
Parameters:
{AjxListener} listener
the listener

scrollPage(up)
Scrolls the list view up or down one page.
Parameters:
{boolean} up
if true, scroll up

selectAll()
Selects all items in the list.

selectItem(selected, selected)
Selects or deselects a single item.
Parameters:
{boolean} selected
if true, select the item
selected

set(list, defaultColumnSort, noResultsOk)
Creates a list view out of the given vector of items. The derived class should override _createItemHtml() in order to display an item.
Parameters:
{AjxVector} list
a vector of items
{number} defaultColumnSort Optional
the default column field to sort
{boolean} noResultsOk
if true, do not show "No Results" for empty list

setEnabled(enabled)
Sets the enabled flag.
Parameters:
{boolean} enabled
if true, enable the list view

setSize(width, height)
Sets the size of the view.
Parameters:
{number|string} width
the width (for example: 100, "100px", "75%")
{number|string} height
the height (for example: 100, "100px", "75%")

setUI(defaultColumnSort, noResultsOk)
Renders the list view using the current list of items.
Parameters:
{string} defaultColumnSort
the ID of column that represents default sort order
{boolean} noResultsOk
if true, do not show "No Results" for empty list

{number} size()
Gets the count of items in the list.
Returns:
{number} the count of items

useListElement()
Use the list elements
    and
  • instead of div and table elements

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:28 GMT-0400 (EDT)