ListWidget - HydraFramework/Hydra GitHub Wiki
onselected:LuaFunction
__section_header_height: Number or LuaFunction
__section_header_data: Map or LuaFunction
__section_footer_height: Number or LuaFunction
__section_footer_data: Map or LuaFunction
__row_height: Number or LuaFunction
__row_data: Map or LuaFunction
__row_count: Number or LuaFunction
__index_titles: Array or LuaFunction
__title_index: Number or LuaFunction
__section_count: Number or LuaFunction
-- section range 0-MAX, row range 0-MAX
list.__row_count = 100
-- or
list.__row_count = function(list, section)
return section * 3 -- 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
local selectedMap = {}
list.__row_data = function(list, section, row)
local item = {
title = {text = selectedMap[section .. "_" .. row] and "selected" or "not selected"},
btn = {
onclick = function()
if selectedMap[section .. "_" .. row] then
selectedMap[section .. "_" .. row] = false
else
selectedMap[section .. "_" .. row] = true
end
list:reload(section, row) -- reload row by section&row
end}
}
return item
end
list.__section_count = 3
list:reload()