targetlist

package
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package targetlist is the selectable record list used by CRUD views.

Index

Constants

View Source
const (
	PartRow   = widget.Part("row")
	PartCheck = widget.Part("check")
	PartBadge = widget.Part("badge")
	PartLabel = widget.Part("label")
	PartList  = widget.Part("list")
)
View Source
const NameTargetList = widget.Name("targetlist")

NameTargetList is the widget identity.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item = view.Item

Item is view.Item, not a copy: a shared shape means crudview.filter's []view.Item flows straight into SetItems, and a host swapping this widget for targetdate (also view.Item-based) needs no re-mapping either. TargetList itself only ever reads ID/Label/Description — LeadTop/Main/Bottom are targetdate's slot, ignored here.

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. Optional.
	OnSelect func(it Item) // row body clicked
	// contains filtered or unexported fields
}

TargetList is a selectable list of records with a multi-selection mode.

func (*TargetList) CheckedIDs added in v0.6.0

func (t *TargetList) CheckedIDs() []string

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 checkmark glyph.

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) OnCheckedChange added in v0.6.0

func (t *TargetList) OnCheckedChange(fn func(int))

func (*TargetList) Render

func (t *TargetList) Render() *Element

func (*TargetList) RenderCSS

func (t *TargetList) RenderCSS() *css.Stylesheet

RenderCSS defines the targetlist visual contract using the style DSL.

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) SetSelectMode added in v0.6.0

func (t *TargetList) SetSelectMode(on bool)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL