<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/DgsComboBoxGetItemData?action=history&amp;feed=atom</id>
	<title>DgsComboBoxGetItemData - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/DgsComboBoxGetItemData?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsComboBoxGetItemData&amp;action=history"/>
	<updated>2026-04-07T09:41:31Z</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=DgsComboBoxGetItemData&amp;diff=74422&amp;oldid=prev</id>
		<title>Thisdp: Created page with &quot;{{Client function}}  This function gets an Item Data associated to a combo box item.  ==Syntax==  &lt;syntaxhighlight lang=&quot;lua&quot;&gt; mixed dgsComboBoxGetItemData ( element combobox, int itemIndex ) &lt;/syntaxhighlight&gt;   ===Required Arguments===  *'''combobox:''' the combobox containing the item you're interested in. *'''itemIndex:''' the item index of the item.  ===Returns=== Returns the item data of the specified item, ''false'' otherwise.  ==Example== This example displays a...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsComboBoxGetItemData&amp;diff=74422&amp;oldid=prev"/>
		<updated>2022-04-05T13:26:29Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Client function}}  This function gets an Item Data associated to a combo box item.  ==Syntax==  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; mixed dgsComboBoxGetItemData ( element combobox, int itemIndex ) &amp;lt;/syntaxhighlight&amp;gt;   ===Required Arguments===  *&amp;#039;&amp;#039;&amp;#039;combobox:&amp;#039;&amp;#039;&amp;#039; the combobox containing the item you&amp;#039;re interested in. *&amp;#039;&amp;#039;&amp;#039;itemIndex:&amp;#039;&amp;#039;&amp;#039; the item index of the item.  ===Returns=== Returns the item data of the specified item, &amp;#039;&amp;#039;false&amp;#039;&amp;#039; otherwise.  ==Example== This example displays a...&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;
&lt;br /&gt;
This function gets an Item Data associated to a combo box item.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
mixed dgsComboBoxGetItemData ( element combobox, int itemIndex )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''combobox:''' the combobox containing the item you're interested in.&lt;br /&gt;
*'''itemIndex:''' the item index of the item.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the item data of the specified item, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example displays a random item data from the combobox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
DGS = exports.dgs&lt;br /&gt;
function clientsideResourceStart ()&lt;br /&gt;
    local numberList = DGS:dgsCreateComboBox ( 10,270,150,30,&amp;quot;test&amp;quot;,false )&lt;br /&gt;
    local item = DGS:dgsComboBoxAddItem ( numberList )&lt;br /&gt;
    local myItem = DGS:dgsComboBoxSetItemText ( numberList, item, tostring( math.random(0, 10) ^ 100 ) )&lt;br /&gt;
    DGS:dgsComboBoxSetItemData( numberList, item, &amp;quot;Test&amp;quot; )&lt;br /&gt;
    local myItemData = DGS:dgsComboBoxGetItemData( numberList, item )&lt;br /&gt;
    outputChatBox ( &amp;quot;My combobox item data: &amp;quot; .. myItemData )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, resourceRoot, clientsideResourceStart )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
mixed dgsComboBoxGetItemData ( element combobox, int itemIndex, mixed key )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''combobox:''' the combobox containing the item you're interested in.&lt;br /&gt;
*'''itemIndex:''' the item index of the item.&lt;br /&gt;
*'''key:''' the key you wish to retrieve the data with.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the item data of the specified item, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example displays a random item data from the combobox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
DGS = exports.dgs&lt;br /&gt;
function clientsideResourceStart ()&lt;br /&gt;
    local numberList = DGS:dgsCreateComboBox ( 10,270,150,30,&amp;quot;test&amp;quot;,false )&lt;br /&gt;
    local item = DGS:dgsComboBoxAddItem ( numberList )&lt;br /&gt;
    local myItem = DGS:dgsComboBoxSetItemText ( numberList, item, tostring( math.random(0, 10) ^ 100 ) )&lt;br /&gt;
    DGS:dgsComboBoxSetItemData( numberList, item, &amp;quot;myKey&amp;quot;, &amp;quot;Test&amp;quot; )&lt;br /&gt;
    local myItemData = DGS:dgsComboBoxGetItemData( numberList, item, &amp;quot;myKey&amp;quot; )&lt;br /&gt;
    outputChatBox ( &amp;quot;My combobox item data: &amp;quot; .. myItemData )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, resourceRoot, clientsideResourceStart )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==See Also==&lt;br /&gt;
{{DGSFUNCTIONS}}&lt;/div&gt;</summary>
		<author><name>Thisdp</name></author>
	</entry>
</feed>