# HG changeset patch # User Daniel Poelzleithner # Date 1285006289 -7200 # Node ID 6e08067e66c1e136b4573452ecb939d9f2a31a75 # Parent 0b7e87f2dc91cfc2673317a6adbbcd774f487b0d allow disabled records in select widget this allows the use record entries as seperators diff -r 0b7e87f2dc91 -r 6e08067e66c1 framework/env/ui/field/select.lua --- a/framework/env/ui/field/select.lua Mon Sep 20 15:29:23 2010 +0200 +++ b/framework/env/ui/field/select.lua Mon Sep 20 20:11:29 2010 +0200 @@ -1,10 +1,11 @@ --[[-- ui.field.select{ ... -- generic ui.field.* arguments, as described for ui.autofield{...} - foreign_records = foreign_records, -- list of records to be chosen from, or function returning such a list - foreign_id = foreign_id, -- name of id field in foreign records - foreign_name = foreign_name, -- name of field to be used as name in foreign records - format_options = format_options -- format options for format.string + foreign_records = foreign_records, -- list of records to be chosen from, or function returning such a list + foreign_id = foreign_id, -- name of id field in foreign records + foreign_name = foreign_name, -- name of field to be used as name in foreign records + format_options = format_options -- format options for format.string + disabled_records = disabled_list -- table of record keys that should be disabled } This function inserts a select field in the active slot. For description of the generic field helper arguments, see help for ui.autofield{...}. @@ -53,6 +54,7 @@ tag = "option", attr = { value = key, + disabled = ((args.disabled_records and args.disabled_records[key] and "1" ) or nil), selected = ((key == args.value) and "selected" or nil) }, content = format.string(