webmcp

changeset 386:e057f8d3f716

Callback of ui.list{...} receives index as second argument
author jbe
date Tue Dec 01 18:50:31 2015 +0100 (2015-12-01)
parents ea3a8c6509ba
children cd9329b3bd78
files framework/env/ui/list.lua
line diff
     1.1 --- a/framework/env/ui/list.lua	Tue Dec 01 17:53:31 2015 +0100
     1.2 +++ b/framework/env/ui/list.lua	Tue Dec 01 18:50:31 2015 +0100
     1.3 @@ -15,7 +15,9 @@
     1.4        ....,                             -- other options for the given ui.field.* functions
     1.5        format         = format,          -- name of the format function to be used (if not using ui_field_type)
     1.6        format_options = format_options,  -- options to be passed to the format function
     1.7 -      content        = content          -- function to output field data per record (ignoring name, format, ...)
     1.8 +      content        = content          -- alternative function to output field data per record
     1.9 +                                        -- (ignoring name, format, etc. when set)
    1.10 +                                        -- (receives record as first and integer index as second argument)
    1.11      },
    1.12      { ... },
    1.13      ...
    1.14 @@ -140,7 +142,7 @@
    1.15                          local field_content
    1.16                          if column.content then
    1.17                            field_content = function()
    1.18 -                            return column.content(record)
    1.19 +                            return column.content(record, record_idx)
    1.20                            end
    1.21                          elseif column.name then
    1.22                            if column.ui_field_type then

Impressum / About Us