s&
newspaper
About
info
About s&box
newspaper
Latest News
published_with_changes
Changes
map
Roadmap
monitoring
Metrics
games
Games
sports_esports
Browse Games
rocket
Discover Games
business_center
Workshop
sports_esports
Games
landscape
Maps
chair
Models
texture
Materials
apparel
Clothing
construction
More..
forum
Forum
docs
Docs
docs
Documentation
dashboard
Api Reference
school
Tutorials
input
Log in with Steam
chevron_left
Change Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية
Api
Classes
BaseVirtualPanel
chevron_left
Classes
class
BaseVirtualPanel
search
Constructors
lock
BaseVirtualPanel
Fields
lock
_cellData
lock
_created
lock
_items
lock
_lastCellCreated
lock
_removals
Properties
data_object
Item
data_object
ItemCount
data_object
Items
data_object
NeedsRebuild
data_object
OnCreateCell
data_object
OnLastCell
Methods
functions
AddItem
functions
AddItems
functions
Clear
lock
FinalLayoutChildren
lock
GetTotalHeight
lock
GetVisibleRange
functions
HasData
functions
InsertItem
lock
PositionPanel
functions
RemoveAt
functions
RemoveItem
functions
SetItems
functions
Tick
lock
UpdateLayout
lock
UpdateLayoutSpacing
BaseVirtualPanel
Base class for virtualized, scrollable panels that only create item panels when visible.
class
Sandbox.UI
.
account_tree
extends
Panel
abstract
Sandbox.Engine
build
Constructors
1
BaseVirtualPanel
(
)
Initializes the base virtual panel with default styles.
crop_din
Fields
5
_cellData
Dictionary`2
_created
Dictionary`2
_items
List`1
_lastCellCreated
bool
_removals
List`1
data_object
Properties
6
Item
RenderFragment`1
Template used to render an item into a cell panel.
ItemCount
int
Gets the number of items in the panel.
Items
IEnumerable`1
Replaces the current items. Only triggers a rebuild if the sequence is actually different. When set to an IList (like List
), changes to the source list will be automatically detected.
NeedsRebuild
bool
When true, forces a layout rebuild on the next Sandbox.UI.BaseVirtualPanel.Tick.
OnCreateCell
Action`2
Called when a cell is created. Allows you to fill the cell in
OnLastCell
Action
Called when the last cell has been viewed. This allows you to view more.
functions
Methods
15
AddItem
(
item
)
Adds a single item and marks the panel for rebuild.
AddItems
(
items
)
Clear
(
)
Clears all items and destroys created panels.
FinalLayoutChildren
(
offset
)
Final layout pass for child panels and scroll bounds.
GetTotalHeight
(
itemCount
)
float
Gets the total height needed to display the specified number of items.
GetVisibleRange
(
first
,
pastEnd
)
Gets the range of visible item indices.
HasData
(
i
)
bool
Returns true if
is a valid item index.
InsertItem
(
index
,
item
)
Inserts an item at the specified index and marks the panel for rebuild.
PositionPanel
(
index
,
panel
)
Positions a panel at the specified index.
RemoveAt
(
index
)
Removes the item at the specified index and marks the panel for rebuild.
RemoveItem
(
item
)
bool
Removes the first occurrence of a specific item and marks the panel for rebuild.
SetItems
(
enumerable
)
Tick
(
)
Per-frame update: adjusts spacing from CSS, updates layout, creates/destroys visible panels.
UpdateLayout
(
)
bool
Updates the layout and returns true if the layout changed.
UpdateLayoutSpacing
(
spacing
)
Updates the layout spacing based on CSS gaps.
Inheritance
Panel
BaseVirtualPanel
VirtualGrid
VirtualList
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.