I want to create a mouse over event on the column of a GWT celltable. Can you help me?
If you mean CellTable, you can try something like that...
table.addCellPreviewHandler(new Handler<IdObject>()
{
@Override
public void onCellPreview(
CellPreviewEvent<IdObject> event)
{
if ("mouseover".equals(event.getNativeEvent().getType())) {
Element cellElement = event.getNativeEvent().getEventTarget().cast();
// play with element
}
}
});
UDP: Method for getting cell value.
private String getElementValue(
Element element)
{
Element child = element.getFirstChildElement().cast();
while (child != null)
{
element = child;
child = element.getFirstChildElement().cast();
}
return element.getFirstChild().getNodeValue();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With