Bulk Data List
Export to create and manage list menus with categories, items, and buttons. Optimized and simple handling of item selection via callbacks.
openList
Opens a new list menu with categories, items, and buttons.
exports['orchid-bridge']:openList(data)data(table) — Menu configuration. Must include:
label
string
Menu title displayed at the top
categories
Category[]
Category:
- label (string) — column label
- options? (table, optional):
• size? ('small'|'mid'|'big') — determines column width fraction. 0.4, 0.7 and 1.2 relatively to default width respectfully .
• noWrap? (boolean) — prevents text wrapping in this column
items
Item[]
Item:
- text (string[]) — text displayed in the column.
- args? (table) — arbitrary data passed to button callbacks.
buttons
Button[]
Button:
- icon (string) — FontAwesome icon name
- label (string) — button tooltip or description
- onSelect (function) — callback function invoked when clicked; receives itemIndex and args
onSelect receives:
itemIndex— the index of the selected item initemsargs— theargstable of the selected item
Example Usage
exports['orchid-bridge']:openList({
label = "Weapons",
categories = {
{ label = "Name", options = { size = 'mid' } },
{ label = "Type", options = { size = 'small', noWrap = true } },
{ label = "Damage", options = { size = 'small' } },
{ label = "Clip Size", options = { size = 'small' } }
},
items = {
{ text = { "Knife", "Melee", "10", "0 Ammo" }, args = { damage = 10 } },
{ text = { "Pistol", "Ranged", "25", "12 Ammo" }, args = { damage = 25 } },
},
buttons = {
{
icon = "fa-solid fa-check",
label = "Select Weapon",
onSelect = function(itemIndex, args)
print("Selected item " .. itemIndex .. " with damage " .. args.damage)
end
}
}
})
closeList
Closes the currently opened list menu.
Last updated