revolist / revogrid

Powerful virtual data grid smartsheet with advanced customization. Best features from excel plus incredible performance 🔋
https://revolist.github.io/revogrid
MIT License
2.68k stars 167 forks source link

Enhance draggable columns functionality with parent-child relationship constraints #395

Open anthonyboutinov opened 1 year ago

anthonyboutinov commented 1 year ago

Issue description:

I would like to request an enhancement to the existing draggable columns functionality in RevoGrid. Currently, draggable columns allow for dragging and rearranging bottom-level headers (nested child columns) but not their parent columns. Additionally, there is no constraint preventing child columns from being dragged out of their parent column or other columns from being dragged into a nested list of columns.

Desired functionality:

Allow parent columns to be draggable along with all their child columns, treating them as one entity. Enable dragging of child columns within their parent column, but prevent them from being dragged outside their parent column.

Current workaround:

I've encountered difficulty in finding a workaround for this issue. My attempts to extend the plugin/moveColumn/columnDragPlugin class and modify the methods have been unsuccessful, as I have not been able to import the necessary components from the @revolist/vue3-datagrid dependency. (Is it possible to import these classes to subclass them? I couldn't find anything in the documentation.) I also tried adding custom logic directly by modifying vgrid.columnPlugin, but this approach has not yielded any results either.

Additional context:

This feature will provide better support for scenarios where column groups have a strong parent-child relationship, ensuring that the organization of the data remains consistent while allowing users to rearrange columns within the constraints of their parent columns.

Thank you for considering this feature request!

hobbitwu commented 1 year ago

Is there any idea to get the child columns which has dragged?