rowData state of ag-grid after drag and drop

I follow the row dragging to external dropzone for ag-grid, but after dragging and dropping, the row data of the grid is still previous state. so when i have this grid as a state of a callback, it uses the row data before dnd. How can i automatically change the row data after dnd?

Hello @zyang2,

rowData wont change its order, virtualRowData will however change.

If you want the rowData to change then you will need to update it from the virtualRowData. However, this could potentially cause a loop as well. So, use with caution.

You could also potentially add your own event listener to work around this as well. :slight_smile:

thank you so much for the answer @jinnyzor ! Apologize, I’m still new to this. so do i need to update virtualRowData in the custom java script?

Nope, when you drag rows, update filters or sort, the virtualRowData will update.

You can use this as a callback input to get the current state of the data.

I am not sure what you mean by update the virtualRowData in JS.

@jinnyzor this is exactly what i wanted! thank you so much!

2 Likes