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 参数的 key

    type: 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();

results matching ""

    No results matching ""