core/dropdown/types.go

Functions Structs

Functions

func DisplayText

DisplayText returns the text to display for this item.

Returns Label if set, otherwise Value.

func (d ItemDef) DisplayText() string {
	if d.Label != "" {
		return d.Label
	}
	return d.Value
}

Structs

type ItemDef struct

ItemDef defines a single item in the dropdown list.

type ItemDef struct {
	// Value is the internal value associated with this item.
	Value	string

	// Label is the display text. If empty, Value is used as the display text.
	Label	string

	// Disabled prevents this item from being selected.
	Disabled	bool
}