viewfn

package
v1.0.20 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Functions = map[string]jet.Func{
	"thumb": Thumb,
}
View Source
var WorkingDir = gpath.WorkingDir()

Functions

func Bind

func Bind(views *jet.Set, fn ...string)

Bind bind global useful functions to view

func Thumb

func Thumb(arguments jet.Arguments) reflect.Value

Types

type ActionType

type ActionType string
const (
	RESET    ActionType = "reset"
	SEARCH   ActionType = "search"
	PAGESIZE ActionType = "pagesize"
	ORDER    ActionType = "order"
)

type Column

type Column struct {
	Type         ColumnType
	Title        string
	Width        string
	Resize       bool
	Order        bool
	Name         string
	Alias        string
	Select       string
	Options      []html.KeyValue
	Actions      html.Renderable
	InputBuilder func(r *evo.Request) html.Renderable
	Attribs      html.Attributes
	QueryBuilder func(r *evo.Request) []string
	SimpleFilter string
	Processor    func(column Column, data map[string]interface{}, r *evo.Request) string
	Model        interface{}
}

func (Column) Filter

func (col Column) Filter(r *evo.Request) html.Renderable

type ColumnType

type ColumnType int
const (
	TEXT    ColumnType = 0
	NUMBER  ColumnType = 1
	DATE    ColumnType = 2
	HTML    ColumnType = 3
	RANGE   ColumnType = 4
	SELECT  ColumnType = 5
	CUSTOM  ColumnType = 6
	ACTIONS ColumnType = 7
	None    ColumnType = 8
)

type CustomizedViews

type CustomizedViews interface {
	DataTable()
}

type FilterView

type FilterView struct {
	Sort        Sort
	Title       string
	Description string
	Style       string
	Columns     []Column
	Select      []string
	Model       interface{}
	Entity      string
	Join        []Join
	Attribs     html.Attributes
	Unscoped    bool
	PickerMode  bool
	PickerTitle func(data map[string]interface{}, r *evo.Request) string
	PickerID    func(data map[string]interface{}, r *evo.Request) string

	QueryBuilder func(r *evo.Request) []string

	Pagination   Pagination
	EnableDebug  bool
	PageActions  []menu.Menu
	BatchActions []menu.Menu
	// contains filtered or unexported fields
}

func (*FilterView) Debug added in v1.0.6

func (fv *FilterView) Debug() *FilterView

func (FilterView) GetData

func (fv FilterView) GetData() []map[string]interface{}

func (*FilterView) Prepare

func (fv *FilterView) Prepare(r *evo.Request) bool

func (FilterView) SizeInput

func (fv FilterView) SizeInput(r *evo.Request) string

type Join

type Join struct {
	Model  interface{}
	MainFK string
	DestFK string
}

type Pagination

type Pagination struct {
	Records     int
	CurrentPage int
	Pages       int
	Limit       int
	First       int
	Last        int
	PageRange   []int
}

type Sort added in v1.0.10

type Sort struct {
	PrimaryKey string
	SortColumn string
}

Jump to

Keyboard shortcuts

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