kmgPage

package
v0.0.0-...-05317bf Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateFromDataRequest

type CreateFromDataRequest struct {
	Data        []map[string]string
	BaseUrl     string
	ItemPerPage int
	CurrentPage int
	StartIndex  int
	EndIndex    int
	PageKeyName string
	DataSize    int
}

type CreateFromSelectCommandRequest

type CreateFromSelectCommandRequest struct {
	Select      *MysqlAst.SelectCommand //必填
	Ctx         kmgHttp.Context         //可选
	Url         string                  //可选
	ItemPerPage int                     //可选
	CurrentPage int                     //可选
	PageKeyName string                  //可选
}

@deprecated

type KmgPage

type KmgPage struct {
	ItemPerPage int                 // 每页数据量
	ShowPageNum int                 // 显示分页的页面的时候,显示出来的页数 如 10,11,12,13,14,15 就是显示了6个页
	PageKeyName string              // 页面参数的名字
	CurrentPage int                 // 当前页数,默认为1
	TotalItem   int                 // 总数据量
	BaseUrl     string              // 不包含页码参数的url,具体渲染url的时候会把页面参数加上
	Data        []map[string]string // 本次分页查询到的数据
	TotalPage   int                 // 共有多少个页面
	StartIndex  int
	EndIndex    int
}

func CreateFromData

func CreateFromData(req CreateFromDataRequest) *KmgPage

func CreateFromSelectCommand

func CreateFromSelectCommand(req CreateFromSelectCommandRequest) *KmgPage

@deprecated

func CreateFromSelectCommandAndHttpContext

func CreateFromSelectCommandAndHttpContext(Select *MysqlAst.SelectCommand, Ctx *kmgHttp.Context) *KmgPage

func CreateFromSelectCommandAndHttpContextByItemPerPage

func CreateFromSelectCommandAndHttpContextByItemPerPage(Select *MysqlAst.SelectCommand, Ctx *kmgHttp.Context, num int) *KmgPage

func (*KmgPage) GetAfterPageUrl

func (page *KmgPage) GetAfterPageUrl() string

后一页的 Url

func (*KmgPage) GetBeforePageUrl

func (page *KmgPage) GetBeforePageUrl() string

前一页的 Url

func (*KmgPage) GetMysqlOffset

func (page *KmgPage) GetMysqlOffset() int

MySQL 数据库的偏移量

func (*KmgPage) GetShowPageArray

func (page *KmgPage) GetShowPageArray() []UrlParam

中间显示的分页的数据

func (*KmgPage) GetTotalItem

func (page *KmgPage) GetTotalItem() int

一共有多少项

func (*KmgPage) GetTotalPage

func (page *KmgPage) GetTotalPage() int

func (*KmgPage) GetUrlWithPage

func (page *KmgPage) GetUrlWithPage(pageNum int) string

获取页面的 Url

func (*KmgPage) HtmlRender

func (page *KmgPage) HtmlRender() string

func (*KmgPage) IsAfterPageActive

func (page *KmgPage) IsAfterPageActive() bool

是否有后向的按钮

func (*KmgPage) IsBeforePageActive

func (page *KmgPage) IsBeforePageActive() bool

是否有向前的按钮

type UrlParam

type UrlParam struct {
	IsCurrent bool
	PageNum   int
	Url       string
}

Jump to

Keyboard shortcuts

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