Documentation
¶
Index ¶
- Variables
- func SetLinkPrefix(s string)
- func ToSnakeCase(str string) string
- func WitTitlePrefix(prefix string) func(*Option)
- func WithDownloadOption(b bool) func(*Option)
- func WithI18n() func(*Option)
- type Action
- type Date
- type DownloadResponse
- type Float
- type Formatter
- type Grid
- type GridColumn
- type Int
- type NullTime
- type Option
- type String
- type Time
Constants ¶
This section is empty.
Variables ¶
View Source
var FieldTagLabel = "grid"
FieldTagLabel holds struct field tag key.
Functions ¶
func SetLinkPrefix ¶
func SetLinkPrefix(s string)
func ToSnakeCase ¶
ToSnakeCase converts string like RobertEgorov to robert_egorov.
func WitTitlePrefix ¶
func WithDownloadOption ¶
Types ¶
type Date ¶
func (Date) ConvertToString ¶
type DownloadResponse ¶
type Float ¶
func (Float) ConvertToString ¶
type Grid ¶
type Grid struct {
Columns []GridColumn `json:"columns"`
Rows [][]string `json:"rows"`
Objects []interface{} `json:"objects,omitempty"`
IsDownloadable bool `json:"isDownloadable"`
Actions [][]Action `json:"actions,omitempty"`
// contains filtered or unexported fields
}
func (*Grid) ApplySliceOfStruct ¶
ApplySliceOfStruct converts slice of any struct to Grid, slice of column and rows.
func (*Grid) DeleteColumns ¶
DeleteColumns deletes columns with exact names in cols.
func (*Grid) ReplaceCellWithFullLinks ¶
type GridColumn ¶
type GridColumn struct {
Name string `json:"name"`
Hidden bool `json:"hidden,omitempty"` // default false
Sortable bool `json:"sortable,omitempty"` // default false
Filterable bool `json:"filterable,omitempty"` // default false
Title string `json:"title,omitempty"` // default ""
Perm string `json:"perm,omitempty"` // default not permission
Type string `json:"type,omitempty"` // default "" (regular text)
Href string `json:"href,omitempty"` // default "" (no link)
Align string `json:"align,omitempty"` // default "" ("left") cell align
Caption string `json:"caption,omitempty"` // default ""
Method string `json:"method,omitempty"` // ?
Icons string `json:"icons,omitempty"` // comma separated fa-* icon names
IconsAlign string `json:"ialign,omitempty"` // default "" ("left") "right" - after text
Target string `json:"target,omitempty"` // default "" browser window target for opening link
}
GridColumn describes grid column's properties.
type Int ¶
func (Int) ConvertToString ¶
type NullTime ¶
func (NullTime) ConvertToString ¶
type String ¶
func (String) ConvertToString ¶
Click to show internal directories.
Click to hide internal directories.