guiGridListInsertRowAfter
Client-side
Server-side
Shared
This allows you to insert a new row after a specified row, and simultaneously set text. Good for inserting new rows in the middle of existing rows. To insert at the top use -1 as row index.
OOP Syntax Help! I don't understand this!
- Method:gui-gridlist:insertRowAfter(...)
Syntax
int|false guiGridListInsertRowAfter ( gui-gridlist gridList, int rowIndex, [ int/string itemText1 = nil, int/string itemText2 = nil, int/string ... = nil ] )Required arguments
- gridList: The grid list you want to add a row to.
- rowIndex: Row ID of the row you want to insert the new row after. Indexes start at 0.
Optional arguments
Note: when using optional arguments, you might need to supply all arguments before the one you wish to use.
- itemText1 (default: nil): The text for the first column item in the row. Either a string or a number can be passed (use numbers for sorting purposes).
- itemText2 (default: nil): The text for the second column item in the row. Either a string or a number can be passed (use numbers for sorting purposes).
- ... (default: nil): Item text for any other columns.
Returns
Returns row id if the row was successfully added, false otherwise.
- int|false: row id
Code Examples
client
This example would create a gridlist then add the current players in the server and if anyone joins, it would insert a row at the top.
local gridlist = guiCreateGridList(100,100,200,100,false)guiGridListAddColumn(gridlist,"Players",0.50)
for i,v in ipairs(getElementsByType("player"))do guiGridListSetItemText(gridlist, guiGridListAddRow(gridlist), 1, getPlayerName(v), false, false)end
addEventHandler("onClientPlayerJoin",root,function() guiGridListSetItemText(gridlist, guiGridListInsertRowAfter(gridlist, -1), 1, getPlayerName(source), false, false) -- Add row at the top of the gridlist and name it the players nameend)See Also
GUI Functions
- getChatboxCharacterLimit
- getChatboxLayout
- guiBlur
- guiBringToFront
- guiCheckBoxGetSelected
- guiCheckBoxSetSelected
- guiComboBoxAddItem
- guiComboBoxClear
- guiComboBoxGetItemCount
- guiComboBoxGetItemText
- guiComboBoxGetSelected
- guiComboBoxIsOpen
- guiComboBoxRemoveItem
- guiComboBoxSetItemText
- guiComboBoxSetOpen
- guiComboBoxSetSelected
- guiCreateBrowser
- guiCreateButton
- guiCreateCheckBox
- guiCreateComboBox
- guiCreateEdit
- guiCreateFont
- guiCreateGridList
- guiCreateLabel
- guiCreateMemo
- guiCreateProgressBar
- guiCreateRadioButton
- guiCreateScrollBar
- guiCreateScrollPane
- guiCreateStaticImage
- guiCreateTab
- guiCreateTabPanel
- guiCreateWindow
- guiDeleteTab
- guiEditGetCaretIndex
- guiEditGetMaxLength
- guiEditIsMasked
- guiEditIsReadOnly
- guiEditSetCaretIndex
- guiEditSetMasked
- guiEditSetMaxLength
- guiEditSetReadOnly
- guiFocus
- guiGetAlpha
- guiGetBrowser
- guiGetCursorType
- guiGetEnabled
- guiGetFont
- guiGetInputEnabled
- guiGetInputMode
- guiGetPosition
- guiGetProperties
- guiGetProperty
- guiGetScreenSize
- guiGetSelectedTab
- guiGetSize
- guiGetText
- guiGetVisible
- guiGridListAddColumn
- guiGridListAddRow
- guiGridListAutoSizeColumn
- guiGridListClear
- guiGridListGetColumnCount
- guiGridListGetColumnTitle
- guiGridListGetColumnWidth
- guiGridListGetHorizontalScrollPosition
- guiGridListGetItemColor
- guiGridListGetItemData
- guiGridListGetItemText
- guiGridListGetRowCount
- guiGridListGetSelectedCount
- guiGridListGetSelectedItem
- guiGridListGetSelectedItems
- guiGridListGetSelectionMode
- guiGridListGetVerticalScrollPosition
- guiGridListInsertRowAfter
- guiGridListIsSortingEnabled
- guiGridListRemoveColumn
- guiGridListRemoveRow
- guiGridListSetColumnTitle
- guiGridListSetColumnWidth
- guiGridListSetHorizontalScrollPosition
- guiGridListSetItemColor
- guiGridListSetItemData
- guiGridListSetItemText
- guiGridListSetScrollBars
- guiGridListSetSelectedItem
- guiGridListSetSelectionMode
- guiGridListSetSortingEnabled
- guiGridListSetVerticalScrollPosition
- guiLabelGetColor
- guiLabelGetFontHeight
- guiLabelGetTextExtent
- guiLabelSetColor
- guiLabelSetHorizontalAlign
- guiLabelSetVerticalAlign
- guiMemoGetCaretIndex
- guiMemoGetVerticalScrollPosition
- guiMemoIsReadOnly
- guiMemoSetCaretIndex
- guiMemoSetReadOnly
- guiMemoSetVerticalScrollPosition
- guiMoveToBack
- guiProgressBarGetProgress
- guiProgressBarSetProgress
- guiRadioButtonGetSelected
- guiRadioButtonSetSelected
- guiScrollBarGetScrollPosition
- guiScrollBarSetScrollPosition
- guiScrollPaneGetHorizontalScrollPosition
- guiScrollPaneGetVerticalScrollPosition
- guiScrollPaneSetHorizontalScrollPosition
- guiScrollPaneSetScrollBars
- guiScrollPaneSetVerticalScrollPosition
- guiSetAlpha
- guiSetEnabled
- guiSetFont
- guiSetInputEnabled
- guiSetInputMode
- guiSetPosition
- guiSetProperty
- guiSetSelectedTab
- guiSetSize
- guiSetText
- guiSetVisible
- guiStaticImageGetNativeSize
- guiStaticImageLoadImage
- guiWindowIsMovable
- guiWindowIsSizable
- guiWindowSetMovable
- guiWindowSetSizable
- isChatBoxInputActive
- isConsoleActive
- isDebugViewActive
- isMainMenuActive
- isMTAWindowActive
- isTransferBoxActive
- setChatboxCharacterLimit
- setDebugViewActive