guy 8 years ago
parent
commit
18b6904c52
  1. 16
      bi/base.js
  2. 7
      bi/case.js
  3. 20
      bi/widget.js
  4. 16
      dist/base.js
  5. 7
      dist/case.js
  6. 20
      dist/widget.js
  7. 10
      src/base/combination/navigation.js
  8. 6
      src/base/table/table.grid.scrollbar.js
  9. 6
      src/case/pager/pager.all.count.js
  10. 1
      src/case/pager/pager.direction.js
  11. 20
      src/widget/pagetable/pagetable.js

16
bi/base.js

@ -3898,12 +3898,8 @@ BI.Navigation = BI.inherit(BI.Widget, {
dynamic: false dynamic: false
}, },
single: false, single: false,
defaultShowIndex: 0, defaultShowIndex: false,
tab: { tab: false,
type: "bi.button_group",
items: [],
layouts: []
},
cardCreator: function (v) { cardCreator: function (v) {
return BI.createWidget(); return BI.createWidget();
}, },
@ -3941,7 +3937,7 @@ BI.Navigation = BI.inherit(BI.Widget, {
}, },
afterCardCreated: BI.bind(this.afterCardCreated, this), afterCardCreated: BI.bind(this.afterCardCreated, this),
afterCardShow: BI.bind(this.afterCardShow, this) afterCardShow: BI.bind(this.afterCardShow, this)
}) });
}, },
mounted: function () { mounted: function () {
@ -30084,6 +30080,12 @@ BI.GridTableHorizontalScrollbar = BI.inherit(BI.Widget, {
populate: function () { populate: function () {
this.scrollbar.populate(); 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"; BI.GridTableHorizontalScrollbar.EVENT_SCROLL = "EVENT_SCROLL";

7
bi/case.js

@ -8614,6 +8614,8 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
}) })
}, },
alwaysShowPager: true,
setAllPages: function (v) { setAllPages: function (v) {
this.allPages.setText("/" + v); this.allPages.setText("/" + v);
this.allPages.setTitle(v); this.allPages.setTitle(v);
@ -8648,10 +8650,6 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
this.pager.setVisible(b); this.pager.setVisible(b);
}, },
getAliasWidth: function () {
return this.options.width - 100;
},
populate: function () { populate: function () {
this.pager.populate(); this.pager.populate();
} }
@ -8908,6 +8906,7 @@ BI.DirectionPager = BI.inherit(BI.Widget, {
this.setVPagerVisible(true); this.setVPagerVisible(true);
vShow = true; vShow = true;
} }
this.setVisible(hShow || vShow);
var num = [74, 111, -9, 28]; var num = [74, 111, -9, 28];
var items = this.layout.attr("items"); var items = this.layout.attr("items");

20
bi/widget.js

@ -12846,7 +12846,7 @@ BI.PageTable = BI.inherit(BI.Widget, {
this.table = BI.createWidget(o.el, { this.table = BI.createWidget(o.el, {
type: "bi.sequence_table", type: "bi.sequence_table",
width: o.width, width: o.width,
height: o.height - 30, height: o.height && o.height - 30,
isNeedResize: true, isNeedResize: true,
isResizeAdapt: false, isResizeAdapt: false,
@ -12970,7 +12970,23 @@ BI.PageTable = BI.inherit(BI.Widget, {
setHeight: function (height) { setHeight: function (height) {
BI.PageTable.superclass.setHeight.apply(this, arguments); 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) { setColumnSize: function (columnSize) {

16
dist/base.js vendored

@ -3898,12 +3898,8 @@ BI.Navigation = BI.inherit(BI.Widget, {
dynamic: false dynamic: false
}, },
single: false, single: false,
defaultShowIndex: 0, defaultShowIndex: false,
tab: { tab: false,
type: "bi.button_group",
items: [],
layouts: []
},
cardCreator: function (v) { cardCreator: function (v) {
return BI.createWidget(); return BI.createWidget();
}, },
@ -3941,7 +3937,7 @@ BI.Navigation = BI.inherit(BI.Widget, {
}, },
afterCardCreated: BI.bind(this.afterCardCreated, this), afterCardCreated: BI.bind(this.afterCardCreated, this),
afterCardShow: BI.bind(this.afterCardShow, this) afterCardShow: BI.bind(this.afterCardShow, this)
}) });
}, },
mounted: function () { mounted: function () {
@ -30084,6 +30080,12 @@ BI.GridTableHorizontalScrollbar = BI.inherit(BI.Widget, {
populate: function () { populate: function () {
this.scrollbar.populate(); 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"; BI.GridTableHorizontalScrollbar.EVENT_SCROLL = "EVENT_SCROLL";

7
dist/case.js vendored

@ -8614,6 +8614,8 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
}) })
}, },
alwaysShowPager: true,
setAllPages: function (v) { setAllPages: function (v) {
this.allPages.setText("/" + v); this.allPages.setText("/" + v);
this.allPages.setTitle(v); this.allPages.setTitle(v);
@ -8648,10 +8650,6 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
this.pager.setVisible(b); this.pager.setVisible(b);
}, },
getAliasWidth: function () {
return this.options.width - 100;
},
populate: function () { populate: function () {
this.pager.populate(); this.pager.populate();
} }
@ -8908,6 +8906,7 @@ BI.DirectionPager = BI.inherit(BI.Widget, {
this.setVPagerVisible(true); this.setVPagerVisible(true);
vShow = true; vShow = true;
} }
this.setVisible(hShow || vShow);
var num = [74, 111, -9, 28]; var num = [74, 111, -9, 28];
var items = this.layout.attr("items"); var items = this.layout.attr("items");

20
dist/widget.js vendored

@ -12846,7 +12846,7 @@ BI.PageTable = BI.inherit(BI.Widget, {
this.table = BI.createWidget(o.el, { this.table = BI.createWidget(o.el, {
type: "bi.sequence_table", type: "bi.sequence_table",
width: o.width, width: o.width,
height: o.height - 30, height: o.height && o.height - 30,
isNeedResize: true, isNeedResize: true,
isResizeAdapt: false, isResizeAdapt: false,
@ -12970,7 +12970,23 @@ BI.PageTable = BI.inherit(BI.Widget, {
setHeight: function (height) { setHeight: function (height) {
BI.PageTable.superclass.setHeight.apply(this, arguments); 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) { setColumnSize: function (columnSize) {

10
src/base/combination/navigation.js

@ -10,12 +10,8 @@ BI.Navigation = BI.inherit(BI.Widget, {
dynamic: false dynamic: false
}, },
single: false, single: false,
defaultShowIndex: 0, defaultShowIndex: false,
tab: { tab: false,
type: "bi.button_group",
items: [],
layouts: []
},
cardCreator: function (v) { cardCreator: function (v) {
return BI.createWidget(); return BI.createWidget();
}, },
@ -53,7 +49,7 @@ BI.Navigation = BI.inherit(BI.Widget, {
}, },
afterCardCreated: BI.bind(this.afterCardCreated, this), afterCardCreated: BI.bind(this.afterCardCreated, this),
afterCardShow: BI.bind(this.afterCardShow, this) afterCardShow: BI.bind(this.afterCardShow, this)
}) });
}, },
mounted: function () { mounted: function () {

6
src/base/table/table.grid.scrollbar.js

@ -404,6 +404,12 @@ BI.GridTableHorizontalScrollbar = BI.inherit(BI.Widget, {
populate: function () { populate: function () {
this.scrollbar.populate(); 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"; BI.GridTableHorizontalScrollbar.EVENT_SCROLL = "EVENT_SCROLL";

6
src/case/pager/pager.all.count.js

@ -119,6 +119,8 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
}) })
}, },
alwaysShowPager: true,
setAllPages: function (v) { setAllPages: function (v) {
this.allPages.setText("/" + v); this.allPages.setText("/" + v);
this.allPages.setTitle(v); this.allPages.setTitle(v);
@ -153,10 +155,6 @@ BI.AllCountPager = BI.inherit(BI.Widget, {
this.pager.setVisible(b); this.pager.setVisible(b);
}, },
getAliasWidth: function () {
return this.options.width - 100;
},
populate: function () { populate: function () {
this.pager.populate(); this.pager.populate();
} }

1
src/case/pager/pager.direction.js

@ -249,6 +249,7 @@ BI.DirectionPager = BI.inherit(BI.Widget, {
this.setVPagerVisible(true); this.setVPagerVisible(true);
vShow = true; vShow = true;
} }
this.setVisible(hShow || vShow);
var num = [74, 111, -9, 28]; var num = [74, 111, -9, 28];
var items = this.layout.attr("items"); var items = this.layout.attr("items");

20
src/widget/pagetable/pagetable.js

@ -78,7 +78,7 @@ BI.PageTable = BI.inherit(BI.Widget, {
this.table = BI.createWidget(o.el, { this.table = BI.createWidget(o.el, {
type: "bi.sequence_table", type: "bi.sequence_table",
width: o.width, width: o.width,
height: o.height - 30, height: o.height && o.height - 30,
isNeedResize: true, isNeedResize: true,
isResizeAdapt: false, isResizeAdapt: false,
@ -202,7 +202,23 @@ BI.PageTable = BI.inherit(BI.Widget, {
setHeight: function (height) { setHeight: function (height) {
BI.PageTable.superclass.setHeight.apply(this, arguments); 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) { setColumnSize: function (columnSize) {

Loading…
Cancel
Save