widgets

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TypeRadios radios
	TypeRadios = "radios"
	// TypeCheckboxs checkboxs
	TypeCheckboxs = "checkboxs"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Dropdown struct {
	Label string
	Items []*Link
}

Dropdown dropdown

func NewDropdown

func NewDropdown(label string, links ...*Link) *Dropdown

NewDropdown new dropdown

type Field

type Field map[string]interface{}

Field field

func NewCheckbox

func NewCheckbox(id, label string, checked bool) Field

NewCheckbox new checkbox field

func NewCheckboxs

func NewCheckboxs(id, label string, value []interface{}, options ...Option) Field

NewCheckboxs new checkboxs field

func NewEmailField

func NewEmailField(id, label, value string) Field

NewEmailField new email field

func NewHiddenField

func NewHiddenField(id string, value interface{}) Field

NewHiddenField new hidden field

func NewPasswordField

func NewPasswordField(id, label, helper string) Field

NewPasswordField new password field

func NewRadios

func NewRadios(id, label string, value interface{}, options ...Option) Field

NewRadios new radios filed

func NewSelect

func NewSelect(id, label string, value interface{}, options ...Option) Field

NewSelect new select field

func NewSortSelect

func NewSortSelect(id, label string, value, min, max int) Field

NewSortSelect new sort select

func NewTextField

func NewTextField(id, label, value string) Field

NewTextField new text field

func NewTextarea

func NewTextarea(id, label, value string, rows int) Field

NewTextarea new textarea field

func (Field) Helper

func (p Field) Helper(h string)

Helper set helper message

func (Field) Readonly

func (p Field) Readonly()

Readonly set readonly

type Form

type Form map[string]interface{}

Form form

func NewForm

func NewForm(req *http.Request, lang, action, next, title string, fields ...interface{}) Form

NewForm new form

func (Form) Append

func (p Form) Append(fields ...Field)

Append append fields

func (Form) Method

func (p Form) Method(m string)

Method set method

type Link struct {
	Label string
	Href  string
}

Link link

func NewLink(label, href string) *Link

NewLink new link

type Option

type Option gin.H

Option select option

func NewOption

func NewOption(label string, value interface{}) Option

NewOption new option

type Pagination

type Pagination struct {
	Href  string        `json:"href"`
	Page  int64         `json:"page"`
	Size  int64         `json:"size"`
	Total int64         `json:"total"`
	Count int64         `json:"count"`
	Items []interface{} `json:"items"`
	Ids   []int64       `json:"ids"`
}

Pagination pagination

func NewPagination

func NewPagination(r *http.Request, total int64) *Pagination

NewPagination new pagination

func (*Pagination) Limit

func (p *Pagination) Limit() int64

Limit limit

func (*Pagination) Offset

func (p *Pagination) Offset() int64

Offset offset

Jump to

Keyboard shortcuts

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