문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top