javascripteventsdrag-and-dropdojodgrid

What event should be used for handling drag and drop of rows in dojo dgrid?


I have a dojo dgrid with DnD support. I want to handle the event when user drags and drops rows of the grid. I was not able to find a list of all events that are supported by dgrid.

I am able to work with other events listed in the Working with Events section such as

grid.on('.dgrid-header .dgrid-cell:click', function (event) {}

however, I cannot find the name of the event to be used for drag&drop.

What is the name of this event?


Solution

  • As mentioned in the link shared by you (Working with Events section), dgrid does not have any events related to dnd.

    However, the dndSource which is extension of dojo/dnd/source has a set of event which you can use to listen.

    on(grid1.dndSource, "Drop", function(){
        //do something
    });
    

    You could also use the dojo/topic to listen to some of the topics published by the dnd.Manager.

    topic.subscribe("/dnd/drop", function(){
        //do something
    });
    

    Below are the list of topic you can listen: