Skip to content

Commit

Permalink
Merge pull request #7 from paodb/enhanced-grid-icon-fix
Browse files Browse the repository at this point in the history
Enhanced grid upgrades
  • Loading branch information
TatuLund committed May 11, 2021
2 parents 0378bd3 + bf5cce3 commit 881d64f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions enhanced-grid-flow-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.vaadin.componentfactory</groupId>
<artifactId>enhanced-grid-flow-demo</artifactId>
<version>0.8.0</version>
<version>0.9.0</version>

<name>Enhanced Grid Demo</name>
<packaging>war</packaging>
Expand Down Expand Up @@ -106,7 +106,7 @@
<dependency>
<groupId>com.vaadin.componentfactory</groupId>
<artifactId>enhanced-grid-flow</artifactId>
<version>0.8.0</version>
<version>0.9.0</version>
</dependency>

<dependency>
Expand Down
4 changes: 2 additions & 2 deletions enhanced-grid-flow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.vaadin.componentfactory</groupId>
<artifactId>enhanced-grid-flow</artifactId>
<version>0.8.0</version>
<version>0.9.0</version>
<packaging>jar</packaging>

<name>Enhanced Grid</name>
Expand Down Expand Up @@ -104,7 +104,7 @@
<dependency>
<groupId>com.vaadin.componentfactory</groupId>
<artifactId>popup</artifactId>
<version>2.2.3</version>
<version>2.2.4</version>
</dependency>

</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.HasValueAndElement;
import com.vaadin.flow.component.dependency.JsModule;
import com.vaadin.flow.component.dependency.Uses;
import com.vaadin.flow.component.grid.ColumnPathRenderer;
import com.vaadin.flow.component.grid.FilterField;
import com.vaadin.flow.component.grid.FilterFieldDto;
Expand All @@ -34,6 +35,7 @@
import com.vaadin.flow.component.grid.SortOrderProvider;
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.component.html.Span;
import com.vaadin.flow.component.icon.Icon;
import com.vaadin.flow.data.renderer.Renderer;
import com.vaadin.flow.function.ValueProvider;
import com.vaadin.flow.internal.HtmlUtils;
Expand All @@ -44,6 +46,7 @@
* and a {@link FilterField filter component} to perform column's filtering.
*
*/
@Uses(Icon.class)
@JsModule(value = "./src/enhanced-grid-sorter.js")
public class EnhancedColumn<T> extends Grid.Column<T> {

Expand Down Expand Up @@ -129,11 +132,9 @@ private void addFilterButtonToHeader(Component headerComponent, HasValueAndEleme
div.getElement().getStyle().set("display", "inline-block");
filterField.setFor(div.getId().get());
headerComponent.getElement().appendChild(div.getElement());

// this is needed to avoid js issues when adding popup
headerComponent.getElement().executeJs("return").then(ignore -> {
headerComponent.getElement().appendChild(filterField.getElement());
});

// add filter field to header
headerComponent.getElement().appendChild(filterField.getElement());

grid.addFilterClickedEventListener(e -> {
if(e.buttonId.equals(getInternalId())) {
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>com.vaadin.componentfactory</groupId>
<artifactId>enhanced-grid-flow-root</artifactId>
<version>0.8.0</version>
<version>0.9.0</version>
<packaging>pom</packaging>
<modules>
<module>enhanced-grid-flow</module>
Expand All @@ -18,7 +18,7 @@
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<enhanced-grid-flow.version>0.8.0</enhanced-grid-flow.version>
<enhanced-grid-flow.version>0.9.0</enhanced-grid-flow.version>
</properties>
<inceptionYear>2020</inceptionYear>
<organization>
Expand Down

0 comments on commit 881d64f

Please sign in to comment.