diff --git a/src/base/pager/pager.js b/src/base/pager/pager.js index c39a9b2ad..15e3fe44f 100644 --- a/src/base/pager/pager.js +++ b/src/base/pager/pager.js @@ -26,7 +26,6 @@ BI.Pager = BI.inherit(BI.Widget, { }, // 初始化当前页 groups: 0, // 连续显示分页数 jump: BI.emptyFn, // 分页的回调函数 - showEllipsis: true, first: false, // 是否显示首页 last: false, // 是否显示尾页 prev: "上一页", @@ -98,7 +97,7 @@ BI.Pager = BI.inherit(BI.Widget, { value: "first", disabled: !(dict.index > 1 && groups !== 0) }); - if (dict.index > 1 && groups !== 0 && o.showEllipsis) { + if (dict.index > 1 && groups !== 0) { view.push({ type: "bi.label", cls: "page-ellipsis", @@ -140,7 +139,7 @@ BI.Pager = BI.inherit(BI.Widget, { // 总页数大于连续分页数,且当前组最大页小于总页,输出尾页 if (((!o.dynamicShow && !o.dynamicShowFirstLast) || (pages > groups && dict.end < pages && groups !== 0)) && last) { - if (pages > groups && dict.end < pages && groups !== 0 && o.showEllipsis) { + if (pages > groups && dict.end < pages && groups !== 0) { view.push({ type: "bi.label", cls: "page-ellipsis", @@ -239,6 +238,10 @@ BI.Pager = BI.inherit(BI.Widget, { this.options.pages = pages; }, + setGroups: function(groups) { + this.options.groups = groups; + }, + hasPrev: function (v) { v || (v = 1); var o = this.options; diff --git a/typescript/base/pager/pager.ts b/typescript/base/pager/pager.ts index 655f00092..ebf843325 100644 --- a/typescript/base/pager/pager.ts +++ b/typescript/base/pager/pager.ts @@ -17,5 +17,7 @@ export declare class Pager extends Widget { setAllPages(v: number): void; + setGroups(v: number): void; + populate(): void; }