Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility problems GwtMaterial table 2.1.1 and 2.2-SNAPSHOT #178

Open
HoochSDS opened this issue Jan 28, 2019 · 1 comment
Open

Compatibility problems GwtMaterial table 2.1.1 and 2.2-SNAPSHOT #178

HoochSDS opened this issue Jan 28, 2019 · 1 comment

Comments

@HoochSDS
Copy link

  1. The order of column and header Argument are different in 2.2-SNAPSHOT, causing errors!
    GwtMaterial table 2.1.1.
  public final void addColumn(Column<T, ?> column, String header)  { 
    this.view.addColumn(column, header);
  }

GwtMaterial table 2.2-SNAPSHOT

  public final void addColumn(String header, Column<T, ?> column) {
    this.view.addColumn(header, column);
  }

Demo Example column definition: error in 2.2-SNAPSHOT

    table.addColumn(new TextColumn<Person>() {
      @Override
      public String getValue(Person object) {
        return object.getFirstName();
      }
    }, "First Name");

  1. 'sortComparator()' cannot override 'sortComparator()' in 'gwt.material.design.client.ui.table.cell.Column'; overridden method is final
    table.addColumn("Last Name", new TextColumn<Person>() {
      @Override
      public Comparator<? super RowComponent<Person>> sortComparator() {
        return (o1, o2) -> o1.getData().getLastName().compareToIgnoreCase(o2.getData().getLastName());
      }

      @Override
      public String getValue(Person object) {
        return object.getLastName();
      }
    });

Thanks

@BenDol
Copy link
Contributor

BenDol commented Jan 29, 2019

With 2.2 you need to pipe the configurations on the Column. Like so:

    table.addColumn("Last Name", new TextColumn<Person>() {
      @Override
      public String getValue(Person object) {
        return object.getLastName();
      }
    }
    .sortComparator((o1, o2) -> o1.getData().getLastName().compareToIgnoreCase(o2.getData().getLastName())));

The demo samples still need to be updated for the 2.2-SNAPSHOT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants