targetlist

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 12 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")
	PartCheckTrash  = widget.Part("check-trash")
	PartCheckPencil = widget.Part("check-pencil")
	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 glyphs the rows use: the shared trash/pencil action glyphs from tinywasm/icons. Each row renders them through currentColor inside the check box, and the crud view's footer buttons ship the same two definitions from their own IconSvg() — same ids, so assetmin collapses them to one symbol each.

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) SetDanger added in v0.6.5

func (t *TargetList) SetDanger(on bool)

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