<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/DgsGridListGetSelectedItems?action=history&amp;feed=atom</id>
	<title>DgsGridListGetSelectedItems - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/DgsGridListGetSelectedItems?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsGridListGetSelectedItems&amp;action=history"/>
	<updated>2026-07-21T03:50:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DgsGridListGetSelectedItems&amp;diff=63239&amp;oldid=prev</id>
		<title>Thisdp at 07:37, 11 July 2019</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsGridListGetSelectedItems&amp;diff=63239&amp;oldid=prev"/>
		<updated>2019-07-11T07:37:57Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 07:37, 11 July 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l57&quot;&gt;Line 57:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 57:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See Also==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See Also==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{DGSFUNCTIONS}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{DGSFUNCTIONS}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{DGSEVENTS}}&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-63213:rev-63239 --&gt;
&lt;/table&gt;</summary>
		<author><name>Thisdp</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DgsGridListGetSelectedItems&amp;diff=63213&amp;oldid=prev</id>
		<title>Thisdp: Created page with &quot;{{Client function}} __NOTOC__ This function returns the items selected in the specified dgs grid list.  Note that the index of row and column start from 1, which is different...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsGridListGetSelectedItems&amp;diff=63213&amp;oldid=prev"/>
		<updated>2019-07-11T06:00:02Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Client function}} __NOTOC__ This function returns the items selected in the specified dgs grid list.  Note that the index of row and column start from 1, which is different...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function returns the items selected in the specified dgs grid list.&lt;br /&gt;
&lt;br /&gt;
Note that the index of row and column start from 1, which is different from [[guiGridListGetSelectedItems]].&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table dgsGridListGetSelectedItems ( element gridList )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''gridList:''' The dgs grid list which selected items you want to retrieve.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table over the selected items in the dgs grid list in this format ( the same as cegui's ) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table = {&lt;br /&gt;
    [1] = {&lt;br /&gt;
        [&amp;quot;column&amp;quot;], -- has the first selected item's column ID&lt;br /&gt;
        [&amp;quot;row&amp;quot;] -- has the first selected item's row ID&lt;br /&gt;
    },&lt;br /&gt;
    [2] = {&lt;br /&gt;
        [&amp;quot;column&amp;quot;],-- has the second selected item's column ID&lt;br /&gt;
        [&amp;quot;row&amp;quot;] -- has the second selected item's row ID&lt;br /&gt;
    },&lt;br /&gt;
    ...&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
if everything was successful or ''false'' if invalid arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
DGS = exports.dgs&lt;br /&gt;
-- This example creates a grid list of all players, clicking &amp;quot;Selected&amp;quot; button will then use dgsGridListGetSelectedItems to show all selected items.&lt;br /&gt;
playerWindow = DGS:dgsCreateWindow(526, 230, 291, 284, &amp;quot;&amp;quot;, false)&lt;br /&gt;
gridlistPlayers = DGS:dgsCreateGridList(9, 23, 272, 201, false, playerWindow)&lt;br /&gt;
DGS:dgsGridListAddColumn(gridlistPlayers, &amp;quot;Players&amp;quot;, 0.9)&lt;br /&gt;
DGS:dgsGridListSetSelectionMode(gridlistPlayers, 1) -- So can select many players&lt;br /&gt;
for _, players in ipairs(getElementsByType(&amp;quot;player&amp;quot;)) do &lt;br /&gt;
	local row = DGS:dgsGridListAddRow(gridlistPlayers)&lt;br /&gt;
	DGS:dgsGridListSetItemText(gridlistPlayers, row, 1, getPlayerName(players))&lt;br /&gt;
end &lt;br /&gt;
buttonSelectedPlayer = DGS:dgsCreateButton(9, 227, 272, 20, &amp;quot;Selected&amp;quot;, false, playerWindow)&lt;br /&gt;
&lt;br /&gt;
function seeSelected()&lt;br /&gt;
	local selected = DGS:dgsGridListGetSelectedItems(gridlistPlayers)&lt;br /&gt;
	for i, data in ipairs(selected) do -- Loops through all selected items&lt;br /&gt;
		outputChatBox(DGS:dgsGridListGetItemText(gridlistPlayers, data[&amp;quot;row&amp;quot;], 1)) -- Shows player name of selected players&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onDgsMouseClick&amp;quot;, buttonSelectedPlayer, seeSelected, false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{DGSFUNCTIONS}}&lt;br /&gt;
{{DGSEVENTS}}&lt;/div&gt;</summary>
		<author><name>Thisdp</name></author>
	</entry>
</feed>