You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Adding ResizeColumnsPlugin to a table causes Resize event to be sent at odd times. For example a resize event is sent when you click on a row. I am also seeing resize events if a dialog is visible and you click on elements in the dialog.
To Reproduce
The below code shows the error. click on any row and you'll see the resize event in the console
Expected behavior
I would guess that resize events should only be sent on an actual resize
public class PnlTableTest extends BaseElement<HTMLDivElement, PnlTableTest> {
protected LocalListDataStore<tabledata> ds = new LocalListDataStore<>();
public PnlTableTest() {
super(ElementsFactory.elements.div().element());
this.appendChild(div()
.addCss(dui_flex, dui_flex_col)
.appendChild(createTable())
);
ArrayList<tabledata> alData = new ArrayList<>();
for (int x=0; x<10; x++)
alData.add(new tabledata("Test "+x));
ds.setData(alData);
}
protected DataTable<tabledata> createTable() {
TableConfig<tabledata> tableConfig = new TableConfig<>();
tableConfig.addColumn(
ColumnConfig.<tabledata>create("Label", "Label")
.setCellRenderer(
cell -> { return text(cell.getTableRow().getRecord().label); }))
.setFixed(true)
.setFixedBodyHeight(Calc.sub(Unit.vh.of(100), Unit.px.of(115)))
.addPlugin(new ResizeColumnsPlugin<tabledata>().configure(config -> config.setClipContent(true)))
.addPlugin(new RowClickPlugin<>(row -> { GWT.log("CLICKED:"+row.getRecord().label); }))
;
DataTable<tabledata> tbl = new DataTable<>(tableConfig, ds);
tbl.removeCss("dui-datatable-striped");
tbl.addTableEventListener(ColumnResizedEvent.COLUMN_RESIZED, evt -> {
ColumnResizedEvent event = Js.uncheckedCast(evt);
GWT.log(evt.getType() + " - " + evt.toString());
GWT.log(event.getColumn().getTitle() + " = " + event.getSizeDiff());
});
return tbl;
}
}
/**
* This is the entry point method.
*/
public void onModuleLoad() {
var layout = AppLayout.create("Domino-ui test");
layout.withContent((parent1, content) -> {
content.appendChild(new PnlTableTest());
});
body().appendChild(layout);
new DlgTest().open();
}
}
Describe the bug
Adding ResizeColumnsPlugin to a table causes Resize event to be sent at odd times. For example a resize event is sent when you click on a row. I am also seeing resize events if a dialog is visible and you click on elements in the dialog.
To Reproduce
The below code shows the error. click on any row and you'll see the resize event in the console
Expected behavior
I would guess that resize events should only be sent on an actual resize
you can also see the full test project here: https://github.com/howudodat/domtest
The text was updated successfully, but these errors were encountered: