Jump to content

[HELP] Adding rows in gridlist from table


Recommended Posts

Posted

Hello guys, I am trying to add rows with info in a gridlist from a table, but I don't really know how to do it...

local items = { 
    {"Infernus", 2}, 
} 
donItemsList = guiCreateGridList(24, 98, 257, 351, false, mainWindow) 
donBItemName = guiGridListAddColumn(donItemsList, "Item Name", 0.9) 
guiGridListAddRow(donItemsList) 
guiGridListSetItemText(donItemsList, 0, 1, "Item 1", false, false) 

The "2" means that the "Infernus" item will be on the second tab from the gridlist.

Thanks.

76561198066470453.png

SP37Ecj.jpg?2MTA:Rust Pre-Alpha Build v.0.3:SP37Ecj.jpg?2

https://forum.mtasa.com/viewtopic.php?f=114&t=97848

2Pac: ''Only God can judge me!''

Posted
  
  
    local items = { 
        {"Infernus", 2}, 
    } 
  
    donItemsList = guiCreateGridList(24, 98, 257, 351, false, mainWindow) 
    donBItemName = guiGridListAddColumn(donItemsList, "Item Name", 0.9) 
  
    for index, value in ipairs (items) do  
        guiGridListAddRow(donItemsList) 
        guiGridListSetItemText(donItemsList, index, value[2], value[1], false, false) 
    end 
  

Currently developing for International Gaming Community - Join us!

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...