diff --git a/bi/base.js b/bi/base.js index efae354a2a..bd50dc576b 100644 --- a/bi/base.js +++ b/bi/base.js @@ -3898,12 +3898,8 @@ BI.Navigation = BI.inherit(BI.Widget, { dynamic: false }, single: false, - defaultShowIndex: 0, - tab: { - type: "bi.button_group", - items: [], - layouts: [] - }, + defaultShowIndex: false, + tab: false, cardCreator: function (v) { return BI.createWidget(); }, @@ -3941,7 +3937,7 @@ BI.Navigation = BI.inherit(BI.Widget, { }, afterCardCreated: BI.bind(this.afterCardCreated, this), afterCardShow: BI.bind(this.afterCardShow, this) - }) + }); }, mounted: function () { @@ -30084,6 +30080,12 @@ BI.GridTableHorizontalScrollbar = BI.inherit(BI.Widget, { populate: function () { this.scrollbar.populate(); + var o = this.options; + if (o.size < 1 || o.contentSize <= o.size) { + this.setVisible(false); + return; + } + this.setVisible(true); } }); BI.GridTableHorizontalScrollbar.EVENT_SCROLL = "EVENT_SCROLL"; diff --git a/bi/case.js b/bi/case.js index 86cab3357d..a17d8e33d6 100644 --- a/bi/case.js +++ b/bi/case.js @@ -8614,6 +8614,8 @@ BI.AllCountPager = BI.inherit(BI.Widget, { }) }, + alwaysShowPager: true, + setAllPages: function (v) { this.allPages.setText("/" + v); this.allPages.setTitle(v); @@ -8648,10 +8650,6 @@ BI.AllCountPager = BI.inherit(BI.Widget, { this.pager.setVisible(b); }, - getAliasWidth: function () { - return this.options.width - 100; - }, - populate: function () { this.pager.populate(); } @@ -8908,6 +8906,7 @@ BI.DirectionPager = BI.inherit(BI.Widget, { this.setVPagerVisible(true); vShow = true; } + this.setVisible(hShow || vShow); var num = [74, 111, -9, 28]; var items = this.layout.attr("items"); diff --git a/bi/widget.js b/bi/widget.js index f3289fdcd9..52b58fb3bf 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -12846,7 +12846,7 @@ BI.PageTable = BI.inherit(BI.Widget, { this.table = BI.createWidget(o.el, { type: "bi.sequence_table", width: o.width, - height: o.height - 30, + height: o.height && o.height - 30, isNeedResize: true, isResizeAdapt: false, @@ -12970,7 +12970,23 @@ BI.PageTable = BI.inherit(BI.Widget, { setHeight: function (height) { BI.PageTable.superclass.setHeight.apply(this, arguments); - this.table.setHeight(height - 30); + var showPager = false; + if (this.pager.alwaysShowPager) { + showPager = true; + } else if (this.pager.hasHNext && this.pager.hasHNext()) { + showPager = true; + } else if (this.pager.hasHPrev && this.pager.hasHPrev()) { + showPager = true; + } else if (this.pager.hasVNext && this.pager.hasVNext()) { + showPager = true; + } else if (this.pager.hasVPrev && this.pager.hasVPrev()) { + showPager = true; + } else if (this.pager.hasNext && this.pager.hasNext()) { + showPager = true; + } else if (this.pager.hasPrev && this.pager.hasPrev()) { + showPager = true; + } + this.table.setHeight(height - (showPager ? 30 : 0)); }, setColumnSize: function (columnSize) { diff --git a/dist/base.js b/dist/base.js index efae354a2a..bd50dc576b 100644 --- a/dist/base.js +++ b/dist/base.js @@ -3898,12 +3898,8 @@ BI.Navigation = BI.inherit(BI.Widget, { dynamic: false }, single: false, - defaultShowIndex: 0, - tab: { - type: "bi.button_group", - items: [], - layouts: [] - }, + defaultShowIndex: false, + tab: false, cardCreator: function (v) { return BI.createWidget(); }, @@ -3941,7 +3937,7 @@ BI.Navigation = BI.inherit(BI.Widget, { }, afterCardCreated: BI.bind(this.afterCardCreated, this), afterCardShow: BI.bind(this.afterCardShow, this) - }) + }); }, mounted: function () { @@ -30084,6 +30080,12 @@ BI.GridTableHorizontalScrollbar = BI.inherit(BI.Widget, { populate: function () { this.scrollbar.populate(); + var o = this.options; + if (o.size < 1 || o.contentSize <= o.size) { + this.setVisible(false); + return; + } + this.setVisible(true); } }); BI.GridTableHorizontalScrollbar.EVENT_SCROLL = "EVENT_SCROLL"; diff --git a/dist/case.js b/dist/case.js index 86cab3357d..a17d8e33d6 100644 --- a/dist/case.js +++ b/dist/case.js @@ -8614,6 +8614,8 @@ BI.AllCountPager = BI.inherit(BI.Widget, { }) }, + alwaysShowPager: true, + setAllPages: function (v) { this.allPages.setText("/" + v); this.allPages.setTitle(v); @@ -8648,10 +8650,6 @@ BI.AllCountPager = BI.inherit(BI.Widget, { this.pager.setVisible(b); }, - getAliasWidth: function () { - return this.options.width - 100; - }, - populate: function () { this.pager.populate(); } @@ -8908,6 +8906,7 @@ BI.DirectionPager = BI.inherit(BI.Widget, { this.setVPagerVisible(true); vShow = true; } + this.setVisible(hShow || vShow); var num = [74, 111, -9, 28]; var items = this.layout.attr("items"); diff --git a/dist/widget.js b/dist/widget.js index f3289fdcd9..52b58fb3bf 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -12846,7 +12846,7 @@ BI.PageTable = BI.inherit(BI.Widget, { this.table = BI.createWidget(o.el, { type: "bi.sequence_table", width: o.width, - height: o.height - 30, + height: o.height && o.height - 30, isNeedResize: true, isResizeAdapt: false, @@ -12970,7 +12970,23 @@ BI.PageTable = BI.inherit(BI.Widget, { setHeight: function (height) { BI.PageTable.superclass.setHeight.apply(this, arguments); - this.table.setHeight(height - 30); + var showPager = false; + if (this.pager.alwaysShowPager) { + showPager = true; + } else if (this.pager.hasHNext && this.pager.hasHNext()) { + showPager = true; + } else if (this.pager.hasHPrev && this.pager.hasHPrev()) { + showPager = true; + } else if (this.pager.hasVNext && this.pager.hasVNext()) { + showPager = true; + } else if (this.pager.hasVPrev && this.pager.hasVPrev()) { + showPager = true; + } else if (this.pager.hasNext && this.pager.hasNext()) { + showPager = true; + } else if (this.pager.hasPrev && this.pager.hasPrev()) { + showPager = true; + } + this.table.setHeight(height - (showPager ? 30 : 0)); }, setColumnSize: function (columnSize) { diff --git a/src/base/combination/navigation.js b/src/base/combination/navigation.js index 7f4cbf3eb3..1ce7d4342b 100644 --- a/src/base/combination/navigation.js +++ b/src/base/combination/navigation.js @@ -10,12 +10,8 @@ BI.Navigation = BI.inherit(BI.Widget, { dynamic: false }, single: false, - defaultShowIndex: 0, - tab: { - type: "bi.button_group", - items: [], - layouts: [] - }, + defaultShowIndex: false, + tab: false, cardCreator: function (v) { return BI.createWidget(); }, @@ -53,7 +49,7 @@ BI.Navigation = BI.inherit(BI.Widget, { }, afterCardCreated: BI.bind(this.afterCardCreated, this), afterCardShow: BI.bind(this.afterCardShow, this) - }) + }); }, mounted: function () { diff --git a/src/base/table/table.grid.scrollbar.js b/src/base/table/table.grid.scrollbar.js index 32f9e71fe9..6faf27cc0e 100644 --- a/src/base/table/table.grid.scrollbar.js +++ b/src/base/table/table.grid.scrollbar.js @@ -404,6 +404,12 @@ BI.GridTableHorizontalScrollbar = BI.inherit(BI.Widget, { populate: function () { this.scrollbar.populate(); + var o = this.options; + if (o.size < 1 || o.contentSize <= o.size) { + this.setVisible(false); + return; + } + this.setVisible(true); } }); BI.GridTableHorizontalScrollbar.EVENT_SCROLL = "EVENT_SCROLL"; diff --git a/src/case/pager/pager.all.count.js b/src/case/pager/pager.all.count.js index 432428f32e..fee63982f9 100644 --- a/src/case/pager/pager.all.count.js +++ b/src/case/pager/pager.all.count.js @@ -119,6 +119,8 @@ BI.AllCountPager = BI.inherit(BI.Widget, { }) }, + alwaysShowPager: true, + setAllPages: function (v) { this.allPages.setText("/" + v); this.allPages.setTitle(v); @@ -153,10 +155,6 @@ BI.AllCountPager = BI.inherit(BI.Widget, { this.pager.setVisible(b); }, - getAliasWidth: function () { - return this.options.width - 100; - }, - populate: function () { this.pager.populate(); } diff --git a/src/case/pager/pager.direction.js b/src/case/pager/pager.direction.js index 3ae115dd41..c946cf7f36 100644 --- a/src/case/pager/pager.direction.js +++ b/src/case/pager/pager.direction.js @@ -249,6 +249,7 @@ BI.DirectionPager = BI.inherit(BI.Widget, { this.setVPagerVisible(true); vShow = true; } + this.setVisible(hShow || vShow); var num = [74, 111, -9, 28]; var items = this.layout.attr("items"); diff --git a/src/widget/pagetable/pagetable.js b/src/widget/pagetable/pagetable.js index 03d884bae1..a2f671eaac 100644 --- a/src/widget/pagetable/pagetable.js +++ b/src/widget/pagetable/pagetable.js @@ -78,7 +78,7 @@ BI.PageTable = BI.inherit(BI.Widget, { this.table = BI.createWidget(o.el, { type: "bi.sequence_table", width: o.width, - height: o.height - 30, + height: o.height && o.height - 30, isNeedResize: true, isResizeAdapt: false, @@ -202,7 +202,23 @@ BI.PageTable = BI.inherit(BI.Widget, { setHeight: function (height) { BI.PageTable.superclass.setHeight.apply(this, arguments); - this.table.setHeight(height - 30); + var showPager = false; + if (this.pager.alwaysShowPager) { + showPager = true; + } else if (this.pager.hasHNext && this.pager.hasHNext()) { + showPager = true; + } else if (this.pager.hasHPrev && this.pager.hasHPrev()) { + showPager = true; + } else if (this.pager.hasVNext && this.pager.hasVNext()) { + showPager = true; + } else if (this.pager.hasVPrev && this.pager.hasVPrev()) { + showPager = true; + } else if (this.pager.hasNext && this.pager.hasNext()) { + showPager = true; + } else if (this.pager.hasPrev && this.pager.hasPrev()) { + showPager = true; + } + this.table.setHeight(height - (showPager ? 30 : 0)); }, setColumnSize: function (columnSize) {