updateBody(rowData, uidl.getIntAttribute("firstrow"),
uidl.getIntAttribute("rows"));
if (headerChangedDuringUpdate) {
- lazyAdjustColumnWidths.schedule(1);
+ triggerLazyColumnAdjustment(true);
} else {
// webkits may still bug with their disturbing scrollbar
// bug, see #3457
}
}
- private void updatePageLength(UIDL uidl) {
+ protected void updatePageLength(UIDL uidl) {
int oldPageLength = pageLength;
if (uidl.hasAttribute("pagelength")) {
pageLength = uidl.getIntAttribute("pagelength");
} else {
tHead.removeCell(colKey);
collapsedColumns.add(colKey);
- lazyAdjustColumnWidths.schedule(1);
+ triggerLazyColumnAdjustment(true);
}
// update variable to server
setContentWidth(innerPixels);
// readjust undefined width columns
- lazyAdjustColumnWidths.cancel();
- lazyAdjustColumnWidths.schedule(LAZY_COLUMN_ADJUST_TIMEOUT);
+ triggerLazyColumnAdjustment(false);
} else {
// Undefined width
sizeInit();
// readjust undefined width columns
- lazyAdjustColumnWidths.cancel();
- lazyAdjustColumnWidths.schedule(LAZY_COLUMN_ADJUST_TIMEOUT);
+ triggerLazyColumnAdjustment(false);
}
/*
return function(){ return false; };
}-*/;
+ protected void triggerLazyColumnAdjustment(boolean now) {
+ lazyAdjustColumnWidths.cancel();
+ if (now) {
+ lazyAdjustColumnWidths.run();
+ } else {
+ lazyAdjustColumnWidths.schedule(LAZY_COLUMN_ADJUST_TIMEOUT);
+ }
+ }
}
import com.vaadin.terminal.gwt.client.ComputedStyle;
import com.vaadin.terminal.gwt.client.RenderSpace;
import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.VConsole;
import com.vaadin.terminal.gwt.client.ui.VScrollTable.VScrollTableBody.VScrollTableRow;
import com.vaadin.terminal.gwt.client.ui.VTreeTable.VTreeTableScrollBody.VTreeTableRow;
int scrollPosition2 = widget.getScrollPosition();
if (scrollPosition != scrollPosition2) {
- VConsole.log("TT scrollpos from " + scrollPosition + " to "
- + scrollPosition2);
widget.setScrollPosition(scrollPosition);
}
+
+ /*
+ * Triggers row calculations, removes cached rows etc. Basically
+ * cleans up state. Be careful if touching this, you will brake
+ * pageLength=0 if you remove this.
+ */
+ onScroll(null);
+
+ /*
+ * Ensure that possibly removed/added scrollbars are considered.
+ */
+ triggerLazyColumnAdjustment(true);
+
collapseRequest = false;
}
if (uidl.hasAttribute("focusedRow")) {
// Make sure that initializedAndAttached & al are not reset when the
// totalrows are updated on expand/collapse requests.
int newTotalRows = uidl.getIntAttribute("totalrows");
- if (collapseRequest) {
- setTotalRows(newTotalRows);
- } else {
- super.setTotalRows(newTotalRows);
- }
+ setTotalRows(newTotalRows);
}
}