Hi together,
the SmartGWT version of scrollToRow does not work on listgrids without fixed record heights (listGrid.setFixedRecordHeights(false)).
While the JS function scrollToRow works perfectly, the GWT version does not use it for whatever reason. Instead it tries to calculate scrolling itself, using a common cell height. As we configured the listgrid to use different record heights, the listgrid can't scroll to the expected row.
Following workaround gives the expected result:
Any chance to get a working version without workaround?
the SmartGWT version of scrollToRow does not work on listgrids without fixed record heights (listGrid.setFixedRecordHeights(false)).
While the JS function scrollToRow works perfectly, the GWT version does not use it for whatever reason. Instead it tries to calculate scrolling itself, using a common cell height. As we configured the listgrid to use different record heights, the listgrid can't scroll to the expected row.
Code:
original ListGrid.java /** * Scroll to the specified row number. * * @param rowNum the row num */ public void scrollToRow(int rowNum) { int cellHeight = getCellHeight(); scrollBodyTo(null, (rowNum - 1) * cellHeight); }
Code:
class ScrollableListGrid extends ListGrid { @Override public native void scrollToRow(int rowNum) /*-{ var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()(); self.scrollToRow(rowNum); }-*/; }
Comment