Explorar el Código

Fixing logic

grid-regression-fix
Tatu Lund hace 5 años
padre
commit
8b4af0a6f2
No account linked to committer's email address
Se han modificado 1 ficheros con 3 adiciones y 5 borrados
  1. 3
    5
      client/src/main/java/com/vaadin/client/widgets/Grid.java

+ 3
- 5
client/src/main/java/com/vaadin/client/widgets/Grid.java Ver fichero

@@ -4155,7 +4155,6 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
* on initialization, but not after that.
*/
private DataSource<T> dataSource;
private Registration dataChangeHandler;

/**
* Currently available row range in DataSource.
@@ -7034,13 +7033,12 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,

// Remove change handler gracefully, otherwise NPE would occur during
// datasource change and rebind
if (dataChangeHandler != null) {
dataChangeHandler.remove();
dataChangeHandler = null;
if (this.dataSource != null) {
this.dataSource.setDataChangeHandler(null);
}

this.dataSource = dataSource;
dataChangeHandler = dataSource.setDataChangeHandler(new DataChangeHandler()) {
dataSource.setDataChangeHandler(new DataChangeHandler() {
@Override
public void dataUpdated(int firstIndex, int numberOfItems) {
escalator.getBody().refreshRows(firstIndex, numberOfItems);

Cargando…
Cancelar
Guardar