Documentation
¶
Overview ¶
Package targetlist is the selectable record list used by CRUD views.
Index ¶
- Constants
- type Item
- type TargetList
- func (t *TargetList) Count() int
- func (t *TargetList) IconSvg() *sprite.Sprite
- func (t *TargetList) Init(_ Ctx)
- func (t *TargetList) Items() []Item
- func (t *TargetList) Render() *Element
- func (t *TargetList) SetItems(items []Item)
- func (t *TargetList) Style() *style.Sheet
- func (t *TargetList) WidgetKind() widget.Kind
- func (t *TargetList) WidgetName() widget.Name
Constants ¶
const ( PartRow = widget.Part("row") PartMenu = widget.Part("menu") PartOptions = widget.Part("options") PartBadge = widget.Part("badge") PartLabel = widget.Part("label") PartList = widget.Part("list") PartBackdrop = widget.Part("backdrop") PartButton = widget.Part("button") PartIcon = widget.Part("icon") PartItem = widget.Part("item") )
const NameTargetList = widget.Name("targetlist")
NameTargetList is the widget identity.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TargetList ¶
type TargetList struct {
Element
// Selected holds the id of the highlighted row. Optional — created if nil so a
// host can share it (e.g. a CRUD view binding the form to the same signal).
Selected *SignalString
// Row callbacks. All optional.
OnSelect func(it Item) // row body clicked
OnEdit func(id string) // ⋮ → Editar
OnDelete func(id string) // ⋮ → Eliminar
// contains filtered or unexported fields
}
TargetList is a selectable list of records with a per-row options menu.
func (*TargetList) Count ¶
func (t *TargetList) Count() int
Count reports how many rows are currently rendered (used by hosts/tests).
func (*TargetList) IconSvg ¶
func (t *TargetList) IconSvg() *sprite.Sprite
IconSvg registers the ⋮ (vertical dots) options glyph. Uses currentColor via the sprite default so CSS controls its color.
func (*TargetList) Init ¶
func (t *TargetList) Init(_ Ctx)
func (*TargetList) Items ¶
func (t *TargetList) Items() []Item
Items returns the current items (the data behind the rendered rows).
func (*TargetList) Render ¶
func (t *TargetList) Render() *Element
func (*TargetList) SetItems ¶
func (t *TargetList) SetItems(items []Item)
SetItems replaces the visible rows. Safe to call from a host on every filter or reload; rows go through the keyed reconcile so their bindings stay wired.
func (*TargetList) Style ¶ added in v0.1.13
func (t *TargetList) Style() *style.Sheet
Style defines the targetlist visual contract using the style DSL.
func (*TargetList) WidgetKind ¶ added in v0.1.13
func (t *TargetList) WidgetKind() widget.Kind
func (*TargetList) WidgetName ¶ added in v0.1.13
func (t *TargetList) WidgetName() widget.Name