bencripps / react-redux-grid

A React Grid/Tree Component written in the Redux Pattern
http://react-redux-grid.herokuapp.com/
MIT License
446 stars 63 forks source link

Is there a way to prevent a node from moving? #223

Open RodriFS-InflightVR opened 5 years ago

RodriFS-InflightVR commented 5 years ago

Hi, Ben!

I have a tree with folders and files and I want to prevent a folder to be nested under a file when dragging. The problem is that I don't have an event for when I start dragging to check what object I'm dragging and an event for where the object is about to be moved to freeze the grid or alert the user and roll back the row to it's original position.

Thanks!

Phenixer commented 4 years ago

+1 We have a tree where some "tip" nodes must not have children.

baloraki commented 4 years ago

Hi, has anyone found a solution?

RodriFS-InflightVR commented 4 years ago

Hi, has anyone found a solution?

Hi, baloraki. What I did is check which row was moved, and if it is an invalid movement, or I don't want the user to move that row, I roll back the grid state to the previous state before it was moved