Jump to content

[HELP] DGS grid list editing capabilities


Recommended Posts

I wanted to ask for help considering DGS grid lists. In the old version with GUI system, you could make a grid with rows, columns and items and if items contained some information, you could double-click on them to change the data in the cell (with another window that pops up, that is). Is there any way to do this in DGS?

Link to comment
14 minutes ago, Kilometrs said:

I wanted to ask for help considering DGS grid lists. In the old version with GUI system, you could make a grid with rows, columns and items and if items contained some information, you could double-click on them to change the data in the cell (with another window that pops up, that is). Is there any way to do this in DGS?

When you double-click create edit box, when you change a data

Link to comment

You can set data to the the item from the gridlist and get it later, Idk if it's what you want but it should work:

DGS = exports.dgs
function clientsideResourceStart ()
    local numberList = DGS:dgsCreateGridList ( 0.80, 0.10, 0.15, 0.60, true )
    local column = DGS:dgsGridListAddColumn ( numberList, "Column Title", 0.85 )
    if ( column ) then
        local row = DGS:dgsGridListAddRow ( numberList )
        local myItem = DGS:dgsGridListSetItemText ( numberList, row, column, tostring( math.random(0, 10) ^ 100 ) )
        DGS:dgsGridListSetItemData ( numberList, row, column, "Test" )
        local myItemData = DGS:dgsGridListGetItemData ( numberList, row, column )
        outputChatBox ( "My gridlist item data: " .. myItemData )
    end
end
addEventHandler ( "onClientResourceStart", resourceRoot, clientsideResourceStart )

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...