Cdlist.addons.Pagination
实例化参数
option.pagination
控制分页控件的展示option.pagination.allwaysShow
是否一直显示首页
,尾页
按钮type: bool | default: true
option.pagination.maxShowPage
最大展示几个页码type: int | default: 3
option.pagination.textLabel
几个固定位置的替换文案type: array | defautl: ['首页', '上一页', '下一页', '尾页']
option.getSetting
获取分页插件配置的回调函数type: string
option.historyEnable
是否开启 history 记录模式type: bool | default: false
option.historyKey
history param 参数的 keytype: string | default: page
option.container
插件容器type: string
用法
new CdList.addons.Pagination({
pagination: {
allwaysShow: false,
maxShowPage: 5,
textLabel: ['头', '上', '下', '尾']
},
getSetting: function (json) {
return {
total: 10
}
},
historyEnable: true,
historyKey: 'mypage',
container: '#mypage-wrap'
});
实例方法
在下面的示例中
pg
为实例化对象
① pg.reset
重置分页插件,一般不需要开发者手动调用
用法
pg.reset();