-
Notifications
You must be signed in to change notification settings - Fork 155
Closed
vaadin/web-components
#195Labels
BFPBug fix prioritised by a customerBug fix prioritised by a customerbugSomething isn't workingSomething isn't workingcomponentsflow
Description
I have a use case, where grid columns are dynamically created each time user makes some selection in the view.
Normally it works fine, but when the columns are re-created, if also a new row should be added, then the following error appears: Cannot read property '__getRowModel' of undefined
It seems to be because of vaadin-grid-column
's grid
property is not set.
Here is a sample code to reproduce the issue:
private Grid<Bean> grid;
private List<Bean> beans;
public SampleGridTest() {
grid = new Grid<>();
beans = new ArrayList<>();
beans.add(new Bean("Hello"));
Button addButton = new Button("add");
addButton.addClickListener(evt -> {
beans.add(new Bean("Hello"));
grid.removeAllColumns();
grid.addColumn(Bean::getValue).setHeader("Bean");
grid.setDataProvider(DataProvider.ofCollection(beans));
});
grid.addColumn(Bean::getValue).setHeader("Bean");
grid.setDataProvider(DataProvider.ofCollection(beans));
add(grid, addButton);
}
Vaadin version : 13.0.1
Browser : Chrome Version 72
martinisraelsen
Metadata
Metadata
Assignees
Labels
BFPBug fix prioritised by a customerBug fix prioritised by a customerbugSomething isn't workingSomething isn't workingcomponentsflow