Versions in this module Expand all Collapse all v0 v0.2.0 Jun 2, 2023 v0.1.9 Jun 2, 2023 Changes in this version + const StaticPath + var ValidatorList = map[string]map[ActionType]map[string][]ValidatorItem + func ConvertModeToMap(data any) map[string]any + func InitializeTemplateFun() template.FuncMap + type ActionType int + const DataAdd + const DataEdit + type EditSourceDataFun func(map[string]any) map[string]any + type Field struct + Array []string + Display FieldDisplayFun + Field string + Icon bool + Image bool + Label bool + Row map[string]any + Value any + func (f *Field) Show() any + type FieldDisplayFun func(model FieldModel) any + type FieldList []TableField + type FieldModel struct + ID any + Row map[string]any + Value any + type Form struct + func NewForm(context *gin.Context, actionType ActionType) *Form + func (f *Form) AddField(fieldName string, field string, formType Type) *Form + func (f *Form) Default(defaultValue any) *Form + func (f *Form) DefaultValueTow(defaultValue any) *Form + func (f *Form) Disable() *Form + func (f *Form) EditForm() *Form + func (f *Form) Editable() *Form + func (f *Form) GetField() FormFieldList + func (f *Form) GetForm(data any) *Form + func (f *Form) HelpMsg(msg string) *Form + func (f *Form) HideBackButton(hideBackButton bool) *Form + func (f *Form) NotAllowEdit(notAllowEdit bool) *Form + func (f *Form) OptionGroup(optionGroups []OptionGroup) *Form + func (f *Form) Options(options []SelectOption) *Form + func (f *Form) ParseForm() *Form + func (f *Form) Placeholder(label string) *Form + func (f *Form) Readonly() *Form + func (f *Form) Require() *Form + func (f *Form) SetAction(actionType ActionType) *Form + func (f *Form) SetEditSourceDataFun(fun EditSourceDataFun) *Form + func (f *Form) SetModel(model handler.ModelAction) *Form + func (f *Form) SetSelectedLabel(labels template.HTML) *Form + func (f *Form) Unique() *Form + type FormField struct + CustomContent any + CustomCss template.CSS + CustomJs template.JS + Display FieldDisplayFun + Editable bool + Field string + FieldClass string + FieldName string + FormType Type + HelpMsg string + HideBackButton bool + Label string + Must bool + NoIcon bool + NotAllowEdit bool + OptionExt template.JS + OptionExt2 template.JS + OptionGroups []OptionGroup + Options []SelectOption + Placeholder string + Readonly bool + SelectedLabel template.HTML + Validator []ValidatorItem + Value any + Value2 any + ValueArr []string + type FormFieldList []FormField + type Grid struct + DataAdd bool + DeleteAble bool + DetailAble bool + EditAble bool + Export bool + HasSearch bool + InitSearch InitSearch + PageData handler.PageData + SearchFields []SearchField + Tips string + func NewGrid(context *gin.Context) *Grid + func (t *Grid) AddField(head string, field string) *Grid + func (t *Grid) BaseUrl() string + func (t *Grid) CurrentUrl(params ...any) string + func (t *Grid) DisableAddData() *Grid + func (t *Grid) DisableDelete() *Grid + func (t *Grid) DisableDetail() *Grid + func (t *Grid) DisableEdit() *Grid + func (t *Grid) Display(displayFun FieldDisplayFun) *Grid + func (t *Grid) EnableDelete() *Grid + func (t *Grid) EnableDetail() *Grid + func (t *Grid) EnableEdit() *Grid + func (t *Grid) FieldSortable() *Grid + func (t *Grid) GetField() FieldList + func (t *Grid) GetSelectWhere() WhereClosure + func (t *Grid) GetTable(pageData handler.PageData) *Grid + func (t *Grid) Icon() *Grid + func (t *Grid) Image() *Grid + func (t *Grid) Label() *Grid + func (t *Grid) Search(searchFields ...SearchField) *Grid + func (t *Grid) SearchValue(params any) any + func (t *Grid) SetInitSearch(optionGroups []OptionGroup, defaultValue string) *Grid + func (t *Grid) SetSelectWhere(where WhereClosure) *Grid + func (t *Grid) SetTips(tips string) *Grid + type Info struct + func NewInfo(context *gin.Context) *Info + func (s *Info) AddField(fieldName string, field string, formType ...Type) *Info + func (s *Info) Display(fun FieldDisplayFun) *Info + func (s *Info) GetField() FormFieldList + func (s *Info) GetInfo(data any) *Info + func (s *Info) HelpMsg(msg string) *Info + func (s *Info) HideBackButton(hideBackButton bool) *Info + func (s *Info) Options(options []SelectOption) *Info + func (s *Info) SetSelectedLabel(labels template.HTML) *Info + type InitSearch struct + DefaultValue string + OptionGroups []OptionGroup + type OptionGroup struct + Group string + Options []SelectOption + type SearchField struct + Field string + Notice string + ShowName string + Type string + type SelectOption struct + Extra map[string]string + Selected bool + SelectedLabel template.HTML + Text string + TextHTML template.HTML + Value string + type TableField struct + Display FieldDisplayFun + Export bool + Field string + ShowName string + Sortable bool + type Type uint8 + const Array + const Checkbox + const CheckboxSingle + const CheckboxStacked + const Code + const Color + const Currency + const Custom + const Date + const DateRange + const Datetime + const DatetimeRange + const Default + const Email + const File + const Hidden + const IconPicker + const Image + const Ip + const Number + const NumberRange + const Password + const Radio + const Rate + const RichText + const Select + const SelectBox + const SelectSingle + const SelectSingleGroup + const Slider + const Switch + const Text + const TextArea + const Url + func (t Type) String() string + type Validator struct + func NewValidator(model handler.ModelAction) *Validator + func (v *Validator) AddValidator(actionType ActionType, formField FormField, validatorItem []ValidatorItem) + func (v *Validator) DataValidator(actionType ActionType, params map[string]string) error + func (v *Validator) SetBaseModel(model *handler.CommonModel) *Validator + type ValidatorItem struct + ValidatorMsg string + ValidatorType ValidatorType + type ValidatorType int + const ValidatorRequire + const ValidatorUnique + type WhereClosure func(*gorm.DB) *gorm.DB