datatable_component

package
v0.3.16 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorFieldsLenMismtach = errors.New("fields and rows fields len mismtach")
)

Functions

This section is empty.

Types

type Datatable

type Datatable[T any] struct {
	hiro.Component
	Props         Props                               `json:"-"`
	Param         dyna.Param                          `json:"-"`
	Query         dyna.Query                          `json:"-"`
	FindDataFunc  func(param dyna.Param, t any) error `json:"-"`
	FieldsFunc    func() [][]Field                    `json:"-"`
	RowFunc       func(builder RowBuilder[T]) Node    `json:"-"`
	ActiveFilters map[string]string                   `json:"-"`
	FiltersFunc   func() Node                         `json:"-"`
	Data          []T                                 `json:"-"`
	// contains filtered or unexported fields
}

func (*Datatable[T]) HandleAutocomplete added in v0.2.9

func (c *Datatable[T]) HandleAutocomplete() error

func (*Datatable[T]) HandleFilter added in v0.2.9

func (c *Datatable[T]) HandleFilter() error

func (*Datatable[T]) HandleLoadMore

func (c *Datatable[T]) HandleLoadMore() error

func (*Datatable[T]) HandleOrder

func (c *Datatable[T]) HandleOrder() error

func (*Datatable[T]) HandleSearch

func (c *Datatable[T]) HandleSearch() error

func (*Datatable[T]) Mount

func (c *Datatable[T]) Mount()

func (*Datatable[T]) Name

func (c *Datatable[T]) Name() string

func (*Datatable[T]) Node

func (c *Datatable[T]) Node() Node

type Field

type Field struct {
	Size     string
	Name     string
	Title    string
	AlignX   string
	Sortable bool
	Border   bool
}

type FieldConfig added in v0.2.2

type FieldConfig struct {
	Truncate bool
}

type Props

type Props struct {
	Name      string
	Title     string
	MinWidth  string
	MaxHeight string
}

type RowBuilder

type RowBuilder[T any] interface {
	Data() T
	Row(nodes ...Node) Node
	Field(node Node, config ...FieldConfig) Node
	Link(link string, nodes ...Node) Node
}

Jump to

Keyboard shortcuts

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