πŸ“‹ ListView

A virtualized list that allows up to thousands of items to be displayed.

This class shares methods and events from Base Widget.

🦠 Functions


AddItem

Adds an item to the list view.

ListView:AddItem(Item)
Type
Parameter
Description

RemoveItem

Removes an item from the list view.

ListView:RemoveItem(Item)
Type
Parameter
Description

ClearListItems

Removes all items from the list view.

ListView:ClearListItems()

ScrollToTop

Scrolls the entire list up to the first item.

ListView:ScrollToTop()

ScrollToBottom

Scrolls the entire list down to the last item.

ListView:ScrollToBottom()

ScrollIndexIntoView

Requests that the item at the given index be scrolled into view.

ListView:ScrollIndexIntoView(Index)
Type
Parameter
Description

Index

SetSelectionMode

Sets the selection mode of the list view.

ListView:SetSelectionMode(SelectionMode)
Type
Parameter
Description

GetSelectionMode

β€” Returns ListViewSelectionMode.

local ret = ListView:GetSelectionMode()

SelectAll

Selects all items in the list view.

ListView:SelectAll()

ClearSelection

Clears the selection in the list view.

ListView:ClearSelection()

πŸš€ Events


GenerateInternalWidget

Triggered when the list view needs to generate the content of an entry widget.

ListView:BindDispatcher("GenerateInternalWidget", function(self)
    -- GenerateInternalWidget was called
    local new_widget = ...
    return new_widget
end)

UpdateInternalWidget

Triggered when the list view needs to update the content of an entry widget.

ListView:BindDispatcher("UpdateInternalWidget", function(self, Item, InternalWidget)
    -- UpdateInternalWidget was called
end)

ListViewScrolled

Triggered when the list view has scrolled.

ListView:BindDispatcher("ListViewScrolled", function(self, ItemOffset, DistanceRemaining)
    -- ListViewScrolled was called
end)

EntrySelectionChanged

Triggered when the selection of an entry changed.

ListView:BindDispatcher("EntrySelectionChanged", function(self, InternalWidget, Item, IsSelected)
    -- EntrySelectionChanged was called
end)

ItemSelectionChanged

Triggered when the selection of an item changed.

ListView:BindDispatcher("ItemSelectionChanged", function(self, Item, IsSelected)
    -- ItemSelectionChanged was called
end)

Last updated