/** * Scrolls to a certain item, using {@link ScrollDestination#ANY}. * <p> * If the item has an open details row, its size will also be taken into * account. * * @param row * zero based index of the item to scroll to in the current view. * @throws IllegalArgumentException * if the provided row is outside the item range */ public void scrollTo(int row) throws IllegalArgumentException { scrollTo(row, ScrollDestination.ANY); }
@Override public void scrollToIndex(int index) { getGrid().scrollTo(index); }
private void onUploadStarted(final FileUploadProgress fileUploadProgress) { updateUploadProgressInfoRowObject(fileUploadProgress); if (isWindowNotAlreadyAttached()) { maximizeWindow(); } grid.scrollTo(fileUploadProgress.getFileUploadId()); }
private void onUploadStarted(final FileUploadProgress fileUploadProgress) { updateUploadProgressInfoRowObject(fileUploadProgress); if (isWindowNotAlreadyAttached()) { maximizeWindow(); } grid.scrollTo(fileUploadProgress.getFileUploadId()); }
@Override public void scrollTo(E item, ScrollDestination destination) { Preconditions.checkNotNullArgument(item); Preconditions.checkNotNullArgument(destination); DataGridItems<E> dataGridItems = getDataGridItemsNN(); if (!dataGridItems.containsItem(item)) { throw new IllegalArgumentException("Unable to find item in DataGrid"); } int rowIndex = dataGridItems.indexOfItem(item); component.scrollTo(rowIndex, WebWrapperUtils.convertToGridScrollDestination(destination)); }
@Override public void scrollToItem(T item) { if (!isBuffered()) { throw new NotBufferedException("The item listing is not in buffered mode"); } int index = requireDataSource().indexOfItem(item); if (index > -1) { getGrid().scrollTo(index); } }
@Override public void scrollToItem(T item) { ObjectUtils.argumentNotNull(item, "Item must be not null"); switch (getRenderingMode()) { case GRID: { Object id = requireDataSource().getId(item); if (id != null) { getGrid().scrollTo(id); } } break; case TABLE: { Object id = requireDataSource().getId(item); if (id != null) { getTable().setCurrentPageFirstItemId(id); } } break; default: break; } }