adsa-cms: github.com/mmanjoura/adsa-cms/sorting Index | Files

package sorting

import "github.com/mmanjoura/adsa-cms/sorting"

Index

Package Files

callbacks.go controller.go publish.go sortable_collection.go sorting.go

func MoveDown Uses

func MoveDown(db *gorm.DB, value sortingInterface, pos int) error

MoveDown move position down

func MoveTo Uses

func MoveTo(db *gorm.DB, value sortingInterface, pos int) error

MoveTo move position to

func MoveUp Uses

func MoveUp(db *gorm.DB, value sortingInterface, pos int) error

MoveUp move position up

func RegisterCallbacks Uses

func RegisterCallbacks(db *gorm.DB)

RegisterCallbacks register callbacks into gorm db instance

type SortableCollection Uses

type SortableCollection struct {
    PrimaryField string
    PrimaryKeys  []string
}

func (*SortableCollection) ConfigureQorMeta Uses

func (sortableCollection *SortableCollection) ConfigureQorMeta(metaor resource.Metaor)

func (*SortableCollection) Scan Uses

func (sortableCollection *SortableCollection) Scan(value interface{}) error

func (SortableCollection) Sort Uses

func (sortableCollection SortableCollection) Sort(results interface{}) error

func (SortableCollection) Value Uses

func (sortableCollection SortableCollection) Value() (driver.Value, error)

type Sorting Uses

type Sorting struct {
    Position int `sql:"DEFAULT:NULL"`
}

Sorting ascending mode

func (*Sorting) ConfigureQorResource Uses

func (s *Sorting) ConfigureQorResource(res resource.Resourcer)

ConfigureQorResource configure sorting for qor admin

func (Sorting) GetPosition Uses

func (position Sorting) GetPosition() int

GetPosition get current position

func (*Sorting) SetPosition Uses

func (position *Sorting) SetPosition(pos int)

SetPosition set position, only set field value, won't save

type SortingDESC Uses

type SortingDESC struct {
    Sorting
}

SortingDESC descending mode

func (SortingDESC) SortingDesc Uses

func (SortingDESC) SortingDesc()

SortingDesc make your model sorting desc by default

Package sorting imports 17 packages (graph) and is imported by 3 packages. Updated 2017-06-08. Refresh now. Tools for package owners.