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/)
tabulator provides helper methods for rendering HTML with Tabulator (http://tabulator.info/)
Index ¶
- Constants
- func StreamTabulatorPage(qw422016 *qt422016.Writer, data PageParams)
- func TabulatorPage(data PageParams) string
- func WriteTabulatorPage(qq422016 qtio422016.Writer, data PageParams)
- type Column
- type ColumnSet
- type Columns
- type FormatterParams
- type PageParams
- type TabulatorColumn
- type TabulatorColumnSet
Constants ¶
View Source
const ( URLCSSLatest = "https://unpkg.com/tabulator-tables/dist/css/tabulator.min.css" URLJSLatest = "https://unpkg.com/tabulator-tables/dist/js/tabulator.min.js" HTMLURLs = `` /* 199-byte string literal not displayed */ )
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 ColumnSet ¶
type ColumnSet struct {
Columns Columns
}
func NewColumnSetSimple ¶ added in v2.8.11
func (ColumnSet) DisplayTexts ¶
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
Click to show internal directories.
Click to hide internal directories.