|
|
@ -6,6 +6,7 @@ import com.vaadin.flow.component.grid.Grid; |
|
|
|
import com.vaadin.flow.component.grid.GridVariant; |
|
|
|
import com.vaadin.flow.component.html.H3; |
|
|
|
import com.vaadin.flow.component.html.Span; |
|
|
|
import com.vaadin.flow.component.notification.Notification; |
|
|
|
import com.vaadin.flow.component.orderedlayout.HorizontalLayout; |
|
|
|
import com.vaadin.flow.component.orderedlayout.VerticalLayout; |
|
|
|
import com.vaadin.flow.data.renderer.ComponentRenderer; |
|
|
@ -73,7 +74,7 @@ public class ActDiariaView extends VerticalLayout { |
|
|
|
|
|
|
|
grid.addColumn(Ticket::getDescription).setHeader("Descripción").setWidth("25em"); |
|
|
|
|
|
|
|
//grid.addColumn().setHeader("Realizar"); |
|
|
|
grid.addColumn(buttonTicketComponentRenderer()).setHeader("Realizar").setFlexGrow(0).setAutoWidth(true); |
|
|
|
|
|
|
|
grid.addThemeVariants(GridVariant.LUMO_WRAP_CELL_CONTENT); |
|
|
|
grid.getStyle().set("opacity", "0.8"); |
|
|
@ -123,4 +124,14 @@ public class ActDiariaView extends VerticalLayout { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public ComponentRenderer<Button, Ticket> buttonTicketComponentRenderer() { |
|
|
|
return new ComponentRenderer<>(ticket -> { |
|
|
|
Button button = new Button("Realizar"); |
|
|
|
button.addClickListener(e -> { |
|
|
|
Notification.show("Accion para ticket: " + ticket.getId()); |
|
|
|
}); |
|
|
|
return button; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
} |