How to fire the drop event by pressing enter on ExtJs

0

I would like to know if I can trigger a drop event by pressing enter on a TreePanel. I am not able to fire the event manually, which I have achieved so far:

mediaCenter.getEl().addKeyMap({
    eventName: "keyup",
    binding: [{
        key: Ext.EventObject.ENTER,
        fn: function() {
            var node = mediaCenter.view.getSelectionModel().getSelection();
            node = node[0];
            var model = mediaCenter.view.getSelectionModel();
            var args = new Object({
                                    node: node,
                                    dropPosition: 1
                                });
            grid.fireEvent('beforeDrop', args);
            console.log(node);
        }
    }]
}));

I want when the user press enter, the node that is selected go to the grid that I created.

Thank you.

    
asked by anonymous 04.08.2014 / 16:46

1 answer

1

Good morning.

You have already tried to do this logic in the so you identify the enter key and remove the node from Tree > and add the values in Grid
I hope I have helped

    
14.08.2014 / 16:10