|
|
@ -96,7 +96,7 @@ BI.GridView = BI.inherit(BI.Widget, { |
|
|
|
this.element.scrollLeft(o.scrollLeft); |
|
|
|
this.element.scrollLeft(o.scrollLeft); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
destroyed: function () { |
|
|
|
destroyed: function () { |
|
|
|
BI.each(this.renderedCells, function(i, cell) { |
|
|
|
BI.each(this.renderedCells, function(i, cell) { |
|
|
|
cell.el._destroy(); |
|
|
|
cell.el._destroy(); |
|
|
@ -262,12 +262,44 @@ BI.GridView = BI.inherit(BI.Widget, { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_isOverflowX: function () { |
|
|
|
|
|
|
|
var o = this.options; |
|
|
|
|
|
|
|
// 兼容一下
|
|
|
|
|
|
|
|
var scrollable = o.scrollable, scrollx = o.scrollx; |
|
|
|
|
|
|
|
if (o.overflowX === false) { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (scrollx) { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (scrollable === true || scrollable === "x") { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_isOverflowY: function () { |
|
|
|
|
|
|
|
var o = this.options; |
|
|
|
|
|
|
|
// 兼容一下
|
|
|
|
|
|
|
|
var scrollable = o.scrollable, scrolly = o.scrolly; |
|
|
|
|
|
|
|
if (o.overflowX === false) { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (scrolly) { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (scrollable === true || scrollable === "x") { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_getMaxScrollLeft: function () { |
|
|
|
_getMaxScrollLeft: function () { |
|
|
|
return Math.max(0, this._getContainerWidth() - this.options.width + (this.options.overflowX ? BI.DOM.getScrollWidth() : 0)); |
|
|
|
return Math.max(0, this._getContainerWidth() - this.options.width + (this._isOverflowX() ? BI.DOM.getScrollWidth() : 0)); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_getMaxScrollTop: function () { |
|
|
|
_getMaxScrollTop: function () { |
|
|
|
return Math.max(0, this._getContainerHeight() - this.options.height + (this.options.overflowY ? BI.DOM.getScrollWidth() : 0)); |
|
|
|
return Math.max(0, this._getContainerHeight() - this.options.height + (this._isOverflowY() ? BI.DOM.getScrollWidth() : 0)); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_getContainerWidth: function () { |
|
|
|
_getContainerWidth: function () { |
|
|
|