Class: ListItem

qui.lists.ListItem(dataopt, …args)

A list item.

Constructor

new ListItem(dataopt, …args)

Parameters:
Name Type Attributes Description
data * <optional>

user data associated with the item

args * <repeatable>

parent class parameters

Mixes In:
Source:

Methods

getData() → {*}

Return the item user data.

Source:
Returns:
Type
*

getKey() → {*}

Return the value that identifies this item across updates. Two items with the same key, at the same position, are the same row, so the list can update it where it is instead of building it again.

Source:
Returns:

the key, or null if the item cannot be identified and must always be rebuilt

Type
*

getList() → {qui.lists.List}

Return the owning list.

Source:
Returns:
Type
qui.lists.List

hide()

Hide the field.

Source:

isExplicitlyHidden() → {Boolean}

Tell if the item has been hidden with qui.lists.ListItem#hide, as opposed to being filtered out by its list's search filter.

Source:
Returns:
Type
Boolean

isHidden() → {Boolean}

Tell if the item is hidden, either because it has been explicitly hidden or because it is currently filtered out by its list's search filter.

Source:
Returns:
Type
Boolean

isMatch(filter) → {Boolean}

Tell if item matches a search filter. By default, uses qui.utils.string.intelliSearch on textual content of the HTML element.

Parameters:
Name Type Description
filter String | RegExp

search filter, possibly precompiled with qui.utils.string.intelliSearchRegExp

Source:
Returns:
Type
Boolean

isSelected()

Tell if item is selected or not.

Source:

(abstract) makeContent() → {jQuery}

Implement this method to create the actual list item content.

Source:
Returns:
Type
jQuery

setData(data)

Set the item user data.

Parameters:
Name Type Description
data *
Source:

setList(list)

Set the owning list.

Parameters:
Name Type Description
list qui.lists.List
Source:

setSelected(selected)

Select or deselect item.

Parameters:
Name Type Description
selected Boolean
Source:

setSelectMode(selectMode)

Set select mode. This is internally called by owning qui.lists.List.

Parameters:
Name Type Description
selectMode String

one of:

Source:

show()

Show the item.

Source:

updateFrom(other) → {Boolean}

Update this item in place, from a freshly built item representing the same row.

The base implementation refuses, so that a list containing items which do not implement this keeps its old rebuild-everything behaviour rather than silently showing stale content.

Parameters:
Name Type Description
other qui.lists.ListItem

the freshly built item

Source:
Returns:

true if the item took the update, false to have the list rebuild the row instead

Type
Boolean