AddElementGrid
Arrange ordinary XLQP controls in responsive columns with automatic height and a scrollable viewport.
AddElementGrid
Creates a responsive grid of ordinary XLQP controls. Each cell owns its own element container; the grid measures content height, creates columns, and maintains a scrollable viewport. Aliases: CreateElementGrid, ElementGrid, AddWidgetGrid, CreateWidgetGrid, and WidgetGrid.
local Grid = Tab:AddElementGrid({Name = "Quick actions", Columns = 2})
Grid:AddButton({Name = "Refresh", Callback = function() print("Refresh") end})
Grid:AddToggle({Name = "Alerts", Default = true, Callback = function(value) print(value) end})Options
| Field | Default / behavior |
|---|---|
Name / Title | Empty; nonempty text adds a title. |
Height, Width, Custom | 220, 500, false. Custom mode uses fixed pixel width and height. |
Rows | True; false uses one column. |
Columns | 0 means automatic columns based on the available width. |
CellWidth | 200, minimum 110. |
CellHeight | 58, minimum 42; measured content may require more space. |
Spacing | 4, minimum 0. |
AutoHeight | True; fits measured content between the height limits when custom sizing is off. |
MinHeight, MaxHeight | 92 and the configured Height; minimum 70. |
Elements | Initial list using Type / Element and Config. |
Controller
AddElement(kind, config) returns the created element and its cell, or nil when unsupported or construction fails. Remove(element), Clear(), SetRows, SetColumns, SetCellSize(width, height), SetSpacing, SetAutoHeight, Resize(height, width), and SetCustom update the grid.
Convenience methods forward Toggle, SmoothToggle, Dropdown, Button, Slider, Textbox, Bind, Label, Paragraph, Colorpicker, RadioGroup, SegmentedControl, Stepper, ProgressBar, InfoCard, Image, Badge, Notice, StatusBox, and ActionRow using their Add*, Create*, or short names.
For selectable cards, use AddOptionGrid.