# HG changeset patch # User jbe # Date 1448992231 -3600 # Node ID e057f8d3f7163a2545d86abb9d2560b838150c1f # Parent ea3a8c6509ba49f409646c3aaa0dc97d2e29bcb2 Callback of ui.list{...} receives index as second argument diff -r ea3a8c6509ba -r e057f8d3f716 framework/env/ui/list.lua --- a/framework/env/ui/list.lua Tue Dec 01 17:53:31 2015 +0100 +++ b/framework/env/ui/list.lua Tue Dec 01 18:50:31 2015 +0100 @@ -15,7 +15,9 @@ ...., -- other options for the given ui.field.* functions format = format, -- name of the format function to be used (if not using ui_field_type) format_options = format_options, -- options to be passed to the format function - content = content -- function to output field data per record (ignoring name, format, ...) + content = content -- alternative function to output field data per record + -- (ignoring name, format, etc. when set) + -- (receives record as first and integer index as second argument) }, { ... }, ... @@ -140,7 +142,7 @@ local field_content if column.content then field_content = function() - return column.content(record) + return column.content(record, record_idx) end elseif column.name then if column.ui_field_type then