int availW = tBody.getAvailableWidth();
// Hey IE, are you really sure about this?
availW = tBody.getAvailableWidth();
-
if (availW > total) {
// natural size is smaller than available space
scrollPositionElement = DOM.createDiv();
DOM.setElementProperty(scrollPositionElement, "className",
"i-table-scrollposition");
- DOM
- .appendChild(RootPanel.get().getElement(),
- scrollPositionElement);
+ DOM.appendChild(getElement(), scrollPositionElement);
}
-
- DOM.setStyleAttribute(scrollPositionElement, "left",
- (DOM.getAbsoluteLeft(getElement())
- + DOM
- .getElementPropertyInt(getElement(),
- "offsetWidth") / 2 - 75)
- + "px");
- DOM.setStyleAttribute(scrollPositionElement, "top", (DOM
- .getAbsoluteTop(getElement()))
- + "px");
+
+ DOM.setStyleAttribute(scrollPositionElement, "position", "absolute");
+ DOM.setStyleAttribute(scrollPositionElement, "marginLeft",
+ (DOM.getElementPropertyInt(getElement(), "offsetWidth") / 2 - 80) + "px");
+ DOM.setStyleAttribute(scrollPositionElement, "marginTop",
+ -(DOM.getElementPropertyInt(getElement(), "offsetHeight") / 2) + "px");
int last = (firstRowInViewPort + pageLength);
if (last > totalRows)
last = totalRows;
- DOM.setInnerHTML(scrollPositionElement, firstRowInViewPort + " - "
- + last + "...");
+ DOM.setInnerHTML(scrollPositionElement, "<span>" + firstRowInViewPort + " – "
+ + last + "..." + "</span>");
DOM.setStyleAttribute(scrollPositionElement, "display", "block");
}
public class HeaderCell extends Widget {
- private static final int DRAG_WIDGET_WIDTH = 2;
+ private static final int DRAG_WIDGET_WIDTH = 4;
private static final int MINIMUM_COL_WIDTH = 20;
private void setSorted(boolean sorted) {
if (sorted) {
if (sortAscending)
- this.setStyleName("header-cell-asc");
+ this.setStyleName(CLASSNAME + "-header-cell-asc");
else
- this.setStyleName("header-cell-desc");
+ this.setStyleName(CLASSNAME + "-header-cell-desc");
} else {
- this.setStyleName("header-cell");
+ this.setStyleName(CLASSNAME + "-header-cell");
}
}
public static final int CELL_EXTRA_WIDTH = 20;
public static final int DEFAULT_ROW_HEIGHT = 25;
+
+ public static final int CELL_CONTENT_PADDING = 3;
private int rowHeight = -1;
for (int i = 0; i < cells; i++) {
Element cell = DOM.getChild(row.getElement(), i);
int w = IScrollTable.this.getColWidth(getColKeyByIndex(i));
+ DOM.setStyleAttribute(DOM.getFirstChild(cell), "width", (w - CELL_CONTENT_PADDING) + "px");
DOM.setStyleAttribute(cell, "width", w + "px");
- DOM.setStyleAttribute(DOM.getFirstChild(cell), "width", w
- + "px");
}
return row;
}
IScrollTableRow first = null;
if (renderedRows.size() > 0)
first = (IScrollTableRow) renderedRows.get(0);
- if (first != null && first.getStyleName().indexOf("i-odd") == -1)
- row.addStyleName("i-odd");
+ if (first != null && first.getStyleName().indexOf("-odd") == -1)
+ row.setStyleName(CLASSNAME + "-row-odd");
+ if (row.isSelected())
+ row.addStyleName("i-selected");
DOM.insertChild(tBody, row.getElement(), 0);
adopt(row);
renderedRows.add(0, row);
if (renderedRows.size() > 0)
last = (IScrollTableRow) renderedRows
.get(renderedRows.size() - 1);
- if (last != null && last.getStyleName().indexOf("i-odd") == -1)
- row.addStyleName("i-odd");
+ if (last != null && last.getStyleName().indexOf("-odd") == -1)
+ row.setStyleName(CLASSNAME + "-row-odd");
+ if (row.isSelected())
+ row.addStyleName("i-selected");
DOM.appendChild(tBody, row.getElement());
adopt(row);
renderedRows.add(row);
int rows = DOM.getChildCount(tBody);
for (int i = 0; i < rows; i++) {
Element cell = DOM.getChild(DOM.getChild(tBody, i), colIndex);
+ DOM.setStyleAttribute(DOM.getFirstChild(cell), "width", (w - CELL_CONTENT_PADDING) + "px");
DOM.setStyleAttribute(cell, "width", w + "px");
- DOM.setStyleAttribute(DOM.getFirstChild(cell), "width", w
- + "px");
}
}