Skip to content
hp-sam edited this page Jun 30, 2014 · 3 revisions
-- section range 0-MAX, row range 0-MAX

local items = {}

for i=1,10 do
    local item
    item = {
        title = {text = "xxx"},
        btn = {
            onclick = function()
                item.title.text = "yyy"
                list:reload(0, i - 1) -- reload row by section&row
            end}
    }
    table.insert(items, item)
end

list.__row_count = #(items)
-- or
list.__row_count = function(list, section)
    return #(items) -- row count by section in list
end

list.__row_height = 60
-- or
list.__row_height = function(list, section, row)
    return 60 -- row height by section&row in list
end

list.__row_data = function(list, section, row)
    return items[row + 1]
end
list.__section_count = 1
list:reload()

Clone this wiki locally