datagrid

package
v0.8.10 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: MIT Imports: 19 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Aggregation

func Aggregation(c *fiber.Ctx, datagrid Datagrid) error

func ConvertDate

func ConvertDate(input string) string

func DeleteData

func DeleteData(c *fiber.Ctx, datagrid Datagrid, id string) error

func Exec

func Exec(c *fiber.Ctx, schemaId string, action string, id string, GetGridMODEL func(schema_id string) Datagrid) error

func ExecTrigger

func ExecTrigger(action string, data interface{}, datagrid Datagrid, query *gorm.DB, c *fiber.Ctx) (interface{}, *gorm.DB, bool, bool)

func ExportExcel

func ExportExcel(c *fiber.Ctx, datagrid Datagrid) error

func FetchData

func FetchData(c *fiber.Ctx, datagrid Datagrid) error

func Filter

func Filter(c *fiber.Ctx, datagrid Datagrid, query *gorm.DB) (*gorm.DB, string)

func ImportExcel

func ImportExcel(c *fiber.Ctx, datagrid Datagrid) error

func Print

func Print(c *fiber.Ctx, datagrid Datagrid) error
func Search(c *fiber.Ctx, GridModel interface{}, query *gorm.DB) *gorm.DB

func StripTags

func StripTags(html string) string

func UpdateRow

func UpdateRow(c *fiber.Ctx, datagrid Datagrid) error

Types

type Column

type Column struct {
	Model       string `json:"model"`
	Label       string `json:"label"`
	GridType    string `json:"grid_type"`
	StructField string `json:"struct_field"`
}

type CustomHeader

type CustomHeader struct {
	Render    bool `json:"render"`
	Preview   bool `json:"preview"`
	Structure []struct {
		ID       string `json:"id"`
		Type     string `json:"type"`
		Children []struct {
			ID      string      `json:"id"`
			Type    string      `json:"type"`
			Colspan string      `json:"colspan"`
			Rowspan string      `json:"rowspan"`
			Label   string      `json:"label"`
			Rotate  int         `json:"rotate"`
			Width   string      `json:"width"`
			Height  string      `json:"height"`
			Model   interface{} `json:"model,omitempty"`
		} `json:"children"`
	} `json:"structure"`
}

type Datagrid

type Datagrid struct {
	Name                       string
	Identity                   string
	DataTable                  string
	MainTable                  string
	DataModel                  interface{}
	Data                       interface{}
	MainModel                  interface{}
	Columns                    []Column
	ColumnList                 []string
	Filters                    map[string]string
	Relations                  []models.GridRelation
	Condition                  string
	Aggergation                string
	Triggers                   map[string]interface{}
	BeforeFetch                func(interface{}, Datagrid, *gorm.DB, *fiber.Ctx) (interface{}, *gorm.DB, bool, bool)
	AfterFetch                 func(interface{}, Datagrid, *gorm.DB, *fiber.Ctx) (interface{}, *gorm.DB, bool, bool)
	BeforeDelete               func(interface{}, Datagrid, *gorm.DB, *fiber.Ctx) (interface{}, *gorm.DB, bool, bool)
	AfterDelete                func(interface{}, Datagrid, *gorm.DB, *fiber.Ctx) (interface{}, *gorm.DB, bool, bool)
	BeforePrint                func(interface{}, Datagrid, *gorm.DB, *fiber.Ctx) (interface{}, *gorm.DB, bool, bool)
	TriggerNameSpace           string
	IsExcelUpload              bool
	ExcelUploadCustomNamespace string
	ExcelUploadCustomTrigger   func(Datagrid, *fiber.Ctx) error
	FillVirtualColumns         func(interface{}) interface{}
}

type ImportExcelRequest

type ImportExcelRequest struct {
	ExcelFile string `json:"excelFile"`
	SchemaID  int    `json:"schemaID"`
}

type RowUpdateData

type RowUpdateData struct {
	Ids   []interface{} `json:"ids"`
	Value interface{}   `json:"value"`
	Model string        `json:"model"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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