OnDgsGridListItemDoubleClick: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Line 26: Line 26:


addEventHandler( "onClientDgsDxGridListItemDoubleClick", root,  
addEventHandler( "onClientDgsDxGridListItemDoubleClick", root,  
     function(element)
     function(item)
         if element then
         if item then
             local text = DGS:dgsDxGridListGetItemText(gridlist , element, column)
             local text = DGS:dgsDxGridListGetItemText(gridlist , item, column)
    outputChatBox( "The number is "..text)
    outputChatBox( "The number is "..text)
         end
         end

Revision as of 22:51, 31 December 2017

This event is activated each time the user double-clicks an item in the element dgs-gridlist.

Parameters

element theElement
  • theElement: The dgs element that was double clicked.

Source

The source of this event is the DGS element that was double clicked.

Example

This example creates a list of grids and prints the items that were double-clicked:


local DGS = exports.dgs

local gridlist = DGS:dgsDxCreateGridList(0.4, 0.4, 0.3, 0.3, true)
local column = DGS:dgsDxGridListAddColumn( gridlist, "Items", 0.6 )

for i = 0, 10 do
    local row = DGS:dgsDxGridListAddRow(gridlist) 
    DGS:dgsDxGridListSetItemText(gridlist, row, column, i) 
end

addEventHandler( "onClientDgsDxGridListItemDoubleClick", root, 
    function(item)
        if item then
            local text = DGS:dgsDxGridListGetItemText(gridlist , item, column)
	    outputChatBox( "The number is "..text)
        end
    end
)

See Also

DGS events

General

Check Box

Combo Box

Drag'N Drop

Edit

Grid List

Menu

Selector

Mouse

Radio Button

Switch Button

Tab

Animation

Plugin

Media

Color Picker

QRCode

Remote Image

Client event functions