DGS Grid List: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Client}} Back To DGS ==Sotring== * DGS Grid List fixed sorting problem <syntaxhighlight lang="lua"> loadstring(exports.dgs:dgsImportFunction())() local gridlist = d...")
 
(Undo revision 69633 by Thisdp (talk))
Tag: Undo
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Client}}
[[Dgs | Back To DGS]]
[[DGS|Back To DGS]]
===Sotring===
==Sotring==  
* DGS Grid List fixed sorting problem
* DGS Grid List fixed sorting problem
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
Line 14: Line 13:
local row = dgsGridListAddRow(gridlist)
local row = dgsGridListAddRow(gridlist)
dgsGridListSetItemText(gridlist,row,1,i)
dgsGridListSetItemText(gridlist,row,1,i)
dgsGridListSetItemText(gridlist,row,2,i-1)
dgsGridListSetItemText(gridlist,row,2,i-1) --No Bugs
end
end
end)
end)
----------------No Bugs
</syntaxhighlight>
===Row Index===
* The Row Index of DGS Grid List is different from GUI Grid List (dgs row = gui row + 1)
<syntaxhighlight lang="lua">
-------------------------DGS
loadstring(exports.dgs:dgsImportFunction())()
local gridlist = dgsCreateGridList(100,100,400,400,false)
dgsGridListAddColumn(gridlist,"test1",0.4)
local row = dgsGridListAddRow(gridlist)  --Add the first row
outputChatBox(row) --Output the index of the first row: 1
-------------------------GUI
local gridlist = guiCreateGridList(100,100,400,400,false)
guiGridListAddColumn(gridlist,"test1",0.4)
local row = guiGridListAddRow(gridlist)  --Add the first row
outputChatBox(row) --Output the index of the first row: 0
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 17:01, 16 March 2021

Back To DGS

Sotring

  • DGS Grid List fixed sorting problem
loadstring(exports.dgs:dgsImportFunction())()
local gridlist = dgsCreateGridList(100,100,400,400,false)
dgsGridListAddColumn(gridlist,"test1",0.4)
dgsGridListAddColumn(gridlist,"test2",0.4)

----------------Click the column to enable the built-in sorting.
addCommandHandler("addRow",function()
	for i=1,20 do
		local row = dgsGridListAddRow(gridlist)
		dgsGridListSetItemText(gridlist,row,1,i)
		dgsGridListSetItemText(gridlist,row,2,i-1) --No Bugs
	end
end)

Row Index

  • The Row Index of DGS Grid List is different from GUI Grid List (dgs row = gui row + 1)
-------------------------DGS
loadstring(exports.dgs:dgsImportFunction())()
local gridlist = dgsCreateGridList(100,100,400,400,false)
dgsGridListAddColumn(gridlist,"test1",0.4)
local row = dgsGridListAddRow(gridlist)  --Add the first row
outputChatBox(row) --Output the index of the first row: 1
-------------------------GUI
local gridlist = guiCreateGridList(100,100,400,400,false)
guiGridListAddColumn(gridlist,"test1",0.4)
local row = guiGridListAddRow(gridlist)  --Add the first row
outputChatBox(row) --Output the index of the first row: 0