tHead.disableBrowserIntelligence();
- boolean willHaveScrollbarz = false;
- if (!(height != null && !height.equals(""))) {
- if (pageLength < totalRows) {
- willHaveScrollbarz = true;
- }
- } else {
- int fakeheight = tBody.getRowHeight() * totalRows;
- int availableHeight = bodyContainer.getElement().getPropertyInt(
- "clientHeight");
- if (fakeheight > availableHeight) {
- willHaveScrollbarz = true;
- }
- }
+ boolean willHaveScrollbarz = willHaveScrollbars();
// fix "natural" width if width not set
if (width == null || "".equals(width)) {
initializedAndAttached = true;
}
+ private boolean willHaveScrollbars() {
+ if (!(height != null && !height.equals(""))) {
+ if (pageLength < totalRows) {
+ return true;
+ }
+ } else {
+ int fakeheight = tBody.getRowHeight() * totalRows;
+ int availableHeight = bodyContainer.getElement().getPropertyInt(
+ "clientHeight");
+ if (fakeheight > availableHeight) {
+ return true;
+ }
+ }
+ return false;
+ }
+
/**
* This method has logic which rows needs to be requested from server when
* user scrolls
// Hey IE, are you really sure about this?
availW = tBody.getAvailableWidth();
availW -= tBody.getCellExtraWidth() * visibleColOrder.length;
+ if (willHaveScrollbars()) {
+ availW -= Util.getNativeScrollbarSize();
+ }
int extraSpace = availW - usedMinimumWidth;
if (extraSpace < 0) {