}
if(width < 0) {
- bodyContainer.setWidth((tBody.getOffsetWidth() + getScrollBarWidth() ) + "px");
+ bodyContainer.setWidth((tBody.getOffsetWidth()) + "px");
tHead.setWidth(bodyContainer.getOffsetWidth());
} else {
bodyContainer.setWidth(width + "px");
}
public void setWidth(int width) {
- DOM.setStyleAttribute(hTableWrapper, "width", (width - getScrollBarWidth()) + "px");
- super.setWidth(width + "px");
+ DOM.setStyleAttribute(hTableWrapper, "width", (width - getColumnSelectorWidth()) + "px");
+ }
+
+ private int getColumnSelectorWidth() {
+ int w = DOM.getElementPropertyInt(columnSelector, "offsetWidth") + 4; // some extra to survive with IE6
+ return w > 0 ? w : 15;
}
public void setColumnCollapsingAllowed(boolean cc) {
}
public IAction[] getActions() {
- IAction[] actions= new IAction[columnOrder.length];
+ String[] cols;
+ if(IScrollTable.this.columnReordering) {
+ cols = columnOrder;
+ } else {
+ cols = visibleColOrder;
+ }
+ IAction[] actions= new IAction[cols.length];
- for (int i = 0; i < columnOrder.length; i++) {
- String cid = columnOrder[i];
+ for (int i = 0; i < cols.length; i++) {
+ String cid = cols[i];
HeaderCell c = getHeaderCell(cid);
VisibleColumnAction a = new VisibleColumnAction(c.getColKey());
a.setCaption(c.getCaption());
}
public int getColWidth(int i) {
- Element e = DOM.getChild(DOM.getChild(tBody, 0), i);
- return DOM.getElementPropertyInt(e, "offsetWidth");
+ if(initDone) {
+ Element e = DOM.getChild(DOM.getChild(tBody, 0), i);
+ return DOM.getElementPropertyInt(e, "offsetWidth");
+ } else {
+ return 0;
+ }
}
public void setColWidth(int colIndex, int w) {