tabulator

package
v2.18.6 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 9 Imported by: 3

Documentation

Overview

tabulator provides helper methods for rendering HTML with Tabulator (http://tabulator.info/)

tabulator provides helper methods for rendering HTML with Tabulator (http://tabulator.info/)

tabulator provides helper methods for rendering HTML with Tabulator (http://tabulator.info/)

Index

Constants

View Source
const (
	FormatterDatetime = "datetime"
	FormatterImage    = "image"
	FormatterMoney    = "money"

	ParamDecimal   = "decimal"
	ParamPrecision = "precision"
	ParamThousand  = "thousand"

	ParamInputFormat        = "inputFormat"
	ParamOutputFormat       = "outputFormat"
	ParamInvalidPlaceholder = "invalidPlaceholder"
	ParamTimezone           = "timezone"
)

Variables

This section is empty.

Functions

func StreamTabulatorPage added in v2.8.11

func StreamTabulatorPage(qw422016 *qt422016.Writer, data PageParams)

func TabulatorPage added in v2.8.11

func TabulatorPage(data PageParams) string

func WriteTabulatorPage added in v2.8.11

func WriteTabulatorPage(qq422016 qtio422016.Writer, data PageParams)

Types

type Column

type Column struct {
	Display string
	Slug    string
	Width   float64
}

type ColumnSet

type ColumnSet struct {
	Columns Columns
}

func NewColumnSetSimple added in v2.8.11

func NewColumnSetSimple(displaynames []string, totalWidth float64) *ColumnSet

func (ColumnSet) DisplayTexts

func (set ColumnSet) DisplayTexts() []string

type Columns added in v2.8.11

type Columns []Column

func (Columns) TabulatorColumnSet added in v2.8.11

func (columns Columns) TabulatorColumnSet() TabulatorColumnSet

type FormatterParams added in v2.8.11

type FormatterParams struct {
	Formatter string
	// Money
	Decimal   string
	Thousand  string
	Symbol    string
	Precision int
	// DateTime
	InputFormat        string // (default: yyyy-MM-dd HH:mm:ss), can set to `iso`
	OutputFormat       string // (default: dd/MM/yyyy HH:mm:ss)
	InvalidPlaceholder string // can set to `utc`
	Timezone           string
}

FormatterParams returns params for use in https://tabulator.info/docs/5.4/format

func (FormatterParams) JS added in v2.8.11

func (fp FormatterParams) JS() map[string]any

func (*FormatterParams) MarshalJSON added in v2.8.11

func (fp *FormatterParams) MarshalJSON() ([]byte, error)

type PageParams added in v2.8.11

type PageParams struct {
	PageTitle          string
	PageLink           string
	TableDomID         string
	Table              table.Table
	ColumnSet          *ColumnSet
	TabulatorColumnSet *TabulatorColumnSet
	TableJSON          []byte
}

func (*PageParams) Inflate added in v2.8.11

func (pp *PageParams) Inflate() error

func (*PageParams) PageLinkHTML added in v2.8.11

func (pp *PageParams) PageLinkHTML() string

func (*PageParams) TableJSONBytesOrEmpty added in v2.8.11

func (pp *PageParams) TableJSONBytesOrEmpty() []byte

func (*PageParams) TabulatorColumnsJSONBytesOrEmpty added in v2.8.11

func (pp *PageParams) TabulatorColumnsJSONBytesOrEmpty() []byte

func (*PageParams) WriteFile added in v2.8.11

func (pp *PageParams) WriteFile(filename string) error

type TabulatorColumn

type TabulatorColumn struct {
	Title           string           `json:"title,omitempty"`
	Field           string           `json:"field,omitempty"`
	Formatter       string           `json:"formatter,omitempty"`
	FormatterParams *FormatterParams `json:"formatterParams,omitempty"`
	Width           float64          `json:"width,omitempty"`
	HeaderFilter    string           `json:"headerFilter,omitempty"`
}

type TabulatorColumnSet

type TabulatorColumnSet struct {
	Columns []TabulatorColumn
}

func BuildColumnsTabulator

func BuildColumnsTabulator(columns []Column) TabulatorColumnSet

func (*TabulatorColumnSet) ColumnsJSON

func (tColSet *TabulatorColumnSet) ColumnsJSON() ([]byte, error)

func (*TabulatorColumnSet) MustColumnsJSON

func (tColSet *TabulatorColumnSet) MustColumnsJSON() []byte

Jump to

Keyboard shortcuts

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