DgsGridListScrollTo

From Multi Theft Auto: Wiki
Revision as of 06:40, 19 April 2021 by Thisdp (talk | contribs) (Created page with "{{Client function}} __NOTOC__ This function scrolls the grid list to the specific item. ==Syntax== <syntaxhighlight lang="lua"> bool dgsGridListScrollTo( element gridList, i...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function scrolls the grid list to the specific item.

Syntax

bool dgsGridListScrollTo( element gridList, int row, int column )

Required Arguments

  • gridList: The dgs grid list element.
  • row: An integer of the row index of the grid list you want to scroll to.
  • column: An integer of the column index of the grid list you want to scroll to.

Returns

Returns true if successful, false otherwise.

Example

This example creates a grid list, puts 2 items in to display the text "Hello" and "world" and clears the grid list after 5 seconds.

DGS = exports.dgs

gridlist = dgsCreateGridList(500,50,600,600,false)
dgsGridListAddColumn(gridlist,"test1",0.4)
dgsGridListAddColumn(gridlist,"test2",0.8)
dgsGridListAddColumn(gridlist,"test3",0.8)
for i=1,500 do
	local row = dgsGridListAddRow(gridlist)
	dgsGridListSetItemText(gridlist,row,1,i.."-1")
	dgsGridListSetItemText(gridlist,row,2,i.."-2")
	dgsGridListSetItemText(gridlist,row,3,i.."-3")
end
setTimer(function()
	dgsGridListScrollTo(gridlist,300,2)
end,100,1)

See Also

Custom Cursor Functions

Multi Language Supports

Animation

3D Element

3D Interface

3D Line

3D Image

3D Text

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Detect Area

Drag'N Drop

Grid List

Image

Memo

Menu

Label

Layout

Line

Progress Bar

Radio Button

Scale Pane

Scroll Bar

Scroll Pane

Selector

Style

Switch Button

Tab Panel

Window

Basic Shape Plugins

Circle

Quadrilateral

Rounded Rectangle

Other Plugins

Blur Box

Canvas

Chart

Color Picker

Effect 3D

Gradient

Mask

Media Browser

Nine Slice

Object Preview Supports

Paste Handler

QRCode

Remote Image

Screen Source

SVG

Tooltips