I'm working on Java, SmartGWT 2.5 & Mozilla FF 3.6.x. I'm using Tree, TreeGrid & TreeNode in my application. I have these events:
addDragMoveHandler(new DragMoveHandler() {
@Override
public void onDragMove(DragMoveEvent event) {
// this is the Node which is moving to other parent
// it's parent is instance of PageFolder
Node movingNode = (Node) getSelectedRecord();
}
});
and
addRowHoverHandler(new RowHoverHandler() {
@Override
public void onRowHover(RowHoverEvent event) {
Node _node = (Node) event.getRecord();
if (_node.getModel() instanceof PageFolder) {
// this _node can be the parent of the moving node
// and it will change it's color using it's attribute in getBaseStyle
_node.setAttribute("canBeParent", true);
}
}
});
I would like to fire onRowHover inside onDragMove, because like this first is called onDragMove and after it is finished it is called onRowHover. If the node can be parent of the dragging Node should be highlighted immediately, not when the Node will be dropped into it. There is also onDragStart and onFolderDroped events. but I like to make only onRowHover and onDragMove synchronized.
There's no need to try to fire the onRowHover event, just call the same logic from your onDragMove handler.