Open pfacmf opened 7 years ago
Right now the onBrowserEvent is actually only partially supported. The idea is that we won't have a need for the typical GWT way of catching column/row events. Instead what can be done is you setup handlers for the widgets inside the cells:
table.addColumn(new WidgetColumn<Person, MaterialButton>() {
@Override
public MaterialButton getValue(Person object) {
MaterialButton button = new MaterialButton();
button.setText(object.getFirstName());
button.addClickHandler(e -> MaterialToast.fire("Clicked " + object.getFirstName()));
return button;
}
});
I plan on getting the onBrowserEvent way working to improve performance for some users in the future. Also would love to accept community help if there is a real need for it on your end.
I created a column with the constructor
gwt.material.design.client.ui.table.cell.Column.Column<T, String>(Cell<String> cell)
but the onBrowserEvent is not called on my cell. As far as I could tracevoid gwt.material.design.client.ui.table.cell.Column.onBrowserEvent(Context context, Element elem, T object, NativeEvent event)
is calling my cell's onBrowserEvent but this method is only referenced in<C> void gwt.material.design.client.ui.table.AbstractDataTable.fireEventToCell(Event event, String eventType, Element parentElem, T rowValue, Context context, HasCell<T, C> column)
, which is not called anywhere.My cell is calling
super("click", "keydown");
in constructor.FieldUpdater set on the column is not called either clicking the cell. I tested this on a TextColumn and on a Column with my custom Cell.
I am using 2.0-rc6