OnDgsGridListSelect: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 14: Line 14:
DGS = exports.dgs
DGS = exports.dgs


local list = DGS:dgsDxCreateGridList (346, 163, 433, 403, false )  --Create the grid list element
local list = DGS:dgsCreateGridList (346, 163, 433, 403, false )  --Create the grid list element
local column = DGS:dgsDxGridListAddColumn( list, "test", 0.5 )  --Create a column in the list
local column = DGS:dgsGridListAddColumn( list, "test", 0.5 )  --Create a column in the list
for i=1,10 do
for i=1,10 do
local row = DGS:dgsDxGridListAddRow ( list )
local row = DGS:dgsGridListAddRow ( list )
DGS:dgsDxGridListSetItemText ( list, row, column, tostring(i) )
DGS:dgsGridListSetItemText ( list, row, column, tostring(i) )
end  
end  


addEventHandler("OnClientDgsDxGridListSelect", list, function ( new, old )
addEventHandler("OnDgsGridListSelect", list, function ( new, old )
outputChatBox("The item of list has been changed. ( Current: "..new.."; Previous: "..old.." )")
outputChatBox("The item of list has been changed. ( Current: "..new.."; Previous: "..old.." )")
end)
end)

Revision as of 13:34, 20 January 2018

This event is triggered each time the item selection of grid list has been changed.

Parameters

  • CurrentItem: The value of current selected item.
  • PreviousItem: The value of previous selected item.

Source

The source of this event is the DGS grid list whose item selection has just been changed.

Example

DGS = exports.dgs

local list = DGS:dgsCreateGridList (346, 163, 433, 403, false )  --Create the grid list element
local column = DGS:dgsGridListAddColumn( list, "test", 0.5 )  --Create a column in the list
for i=1,10 do
	local row = DGS:dgsGridListAddRow ( list )
	DGS:dgsGridListSetItemText ( list, row, column, tostring(i) )
end 

addEventHandler("OnDgsGridListSelect", list, function ( new, old )
	outputChatBox("The item of list has been changed. ( Current: "..new.."; Previous: "..old.." )")
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