5
votes

I created a DataGrid in GWT and made the columns sortable.

The width of the columns in total is wider than the width of the DataGrid. So a horizontal scrollbar appears.

Now the problem is that when I for example sort on the first column, the sorting works ok, but the horizontal scrollbar jumps all the way to the right. This is really an undesired effect.

As soon as the last column is visible this does not happen any more.

Is this a known problem ?

1
Which GWT version do you use? Do you have a link to a working example? - Bob

1 Answers

0
votes

To scroll to the first column of the first row:

dataGrid.getRowElement(0).getCells().getItem(0).scrollIntoView();

If you need to scroll to some specific row:

dataGrid.getRowElement(dataGrid.getVisibleItems().indexOf(object)).getCells().getItem(0).scrollIntoView();

[]'s