Jump to content

[Help/GUI] Store, read and use data from a gridlist


Recommended Posts

I got the XML file made, but now it doesn't read or misses the table, nor does it add rows/values into the gridlist.

  
function setRadioChannel(button, state) 
    local channel = xmlNodeGetChildren(xmlRootTree) 
    if (source == bChanSet) then 
        for k, v in ipairs(channel) do 
        local channelFreq = guiGetText(eChanFreq) 
        local channelDesc = guiGetText(eChanDesc) 
        local row = guiGridListAddRow(gRadioGrid) 
            if channelFreq then 
                guiGridListSetItemText( gRadioGrid, row, colFreq, channelFreq, false, false) 
                guiGridListSetItemData( gRadioGrid, row, colFreq, channelFreq) 
                outputDebugString("channelFreq Read, value " .. tostring(channelFreq) "set to row " .. tostring(row)) 
            end 
            if channelDesc then 
                guiGridListSetItemText( gRadioGrid, row, colDesc, channelDesc, false, false) 
                guiGridListSetItemData( gRadioGrid, row, colDesc, channelDesc) 
                outputDebugString("channelFreq Read, value " .. tostring(channelDesc) "set to row " .. tostring(row)) 
            end 
        end 
    end 
end 
addEventHandler("onClientGUIClick", getRootElement(), setRadioChannel) 
  

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