OnDgsGridListSelect: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Client event}} __NOTOC__ This event is triggered each time the item selection of grid list has been changed. ==Parameters== ''CurrentItem:'' The value of current selected...") |
|||
(7 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
==Parameters== | ==Parameters== | ||
''CurrentItem:'' The value of current selected | *'''CurrentItem:''' The value of current selected row. | ||
''PreviousItem:'' The value of previous selected | *'''CurrentItemColumn:''' The value of current selected column. | ||
*'''PreviousItem:''' The value of previous selected row. | |||
*'''PreviousItemColumn:''' The value of previous selected column. | |||
==Source== | ==Source== | ||
Line 14: | Line 16: | ||
DGS = exports.dgs | DGS = exports.dgs | ||
local list = DGS: | local list = DGS:dgsCreateGridList (346, 163, 433, 403, false ) --Create the grid list element | ||
local column = DGS: | 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: | local row = DGS:dgsGridListAddRow ( list ) | ||
DGS: | DGS:dgsGridListSetItemText ( list, row, column, tostring(i) ) | ||
end | end | ||
addEventHandler(" | addEventHandler("onDgsGridListSelect", list, function ( current, currentcolumn, previous, previouscolumn ) | ||
outputChatBox("The item of list has been changed. ( Current: ".. | outputChatBox("The item of list has been changed. ( Current: "..current.."; Previous: "..previous.." )") | ||
end) | end) | ||
</syntaxhighlight> | </syntaxhighlight> |
Latest revision as of 14:13, 5 April 2018
This event is triggered each time the item selection of grid list has been changed.
Parameters
- CurrentItem: The value of current selected row.
- CurrentItemColumn: The value of current selected column.
- PreviousItem: The value of previous selected row.
- PreviousItemColumn: The value of previous selected column.
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 ( current, currentcolumn, previous, previouscolumn ) outputChatBox("The item of list has been changed. ( Current: "..current.."; Previous: "..previous.." )") end)
See Also
DGS events
General
- onDgsBlur
- onDgsCreate
- onDgsCursorTypeChange
- onDgsCursorStateChange
- onDgsDestroy
- onDgsElementRender
- onDgsElementMove
- onDgsElementSize
- onDgsElementEnter
- onDgsElementLeave
- onDgsFocus
- onDgsKey
- onDgsPositionChange
- onDgsPreRender
- onDgsRender
- onDgsElementScroll
- onDgsSizeChange
- onDgsTextChange
- onDgsWindowClose
- onDgsPropertyChange
Check Box
Combo Box
Drag'N Drop
Edit
Grid List
Menu
Selector
Mouse
- onDgsMousePreClick
- onDgsMouseClick
- onDgsMouseClickDown
- onDgsMouseClickUp
- onDgsMouseDrag
- onDgsMouseDoubleClick
- onDgsMouseDoubleClickDown
- onDgsMouseDoubleClickUp
- onDgsMouseDown
- onDgsMouseHover
- onDgsMouseEnter
- onDgsMouseLeave
- onDgsMouseMultiClick
- onDgsMouseMove
- onDgsMouseStay
- onDgsMouseUp
- onDgsMouseWheel
Radio Button
Switch Button
Tab
Animation
Plugin
Media
- onDgsMediaPlay
- onDgsMediaPause
- onDgsMediaStop
- onDgsMediaLoaded
- onDgsMediaTimeUpdate
- onDgsMediaBrowserReturn
Color Picker
QRCode
Remote Image
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled