Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[data grid] Advanced drag and drop behaviors: Row reordering in Row Grouping and Tree Data #4821

Open
1 of 7 tasks
DanailH opened this issue May 10, 2022 · 41 comments
Open
1 of 7 tasks
Assignees
Labels
component: data grid This is the name of the generic UI component, not the React module! feature: Reordering Related to the data grid Reordering feature new feature New feature or request plan: Premium Impact at least one Premium user umbrella For grouping multiple issues to provide a holistic view waiting for 👍 Waiting for upvotes

Comments

@DanailH
Copy link
Member

DanailH commented May 10, 2022

Summary 💡

Follow up to #206

Currently, when Row Grouping or Tree Data is used, the row reordering feature is disabled. This was intentionally made so in order to ship the feature quicker. Also, at the time, there were a few unanswered questions regarding how the reordering will work when you try to move a child row out of the parent as well as moving a parent to become a child of another parent.

This issue is to track the demand for a feature like that and ultimately start working on the implementation.
Last but not least, it has to be decided if a feature add-on like this should be part of the Pro or the Premium plan

Advanced Drag and Drop Behaviors

"Row Reordering" doesn't properly include all the behaviors expected from dragging and dropping rows. It is one of the possible outcomes of dragging a row to drop it into a different position.

When a row is dragged to a different position, users expect:

Plain data

Tree data

Both behaviors in Tree Data should work combined or independently

Row Grouping

Both behaviors of Row Grouping should work combined or independently

@DanailH DanailH added component: data grid This is the name of the generic UI component, not the React module! new feature New feature or request waiting for 👍 Waiting for upvotes labels May 10, 2022
@ghost
Copy link

ghost commented May 27, 2022

glad this was brought up as we are definitely waiting on this feature for we need it for our tree data.
pretty basic stab at it but I imagine it's mostly about updating the row hierarchies upon drag and drop.

@tvvignesh
Copy link

Was looking for this feature today for our product. Using MUI Pro license. Eagerly awaiting its release. Thanks

@flaviendelangle
Copy link
Member

@tvvignesh what would be the wanted behavior for you ?

Do you want to be able to move a row inside it's parent ?
Do you want to be able to move a row inside another parent and update your row accordingly ?

@edwinvrgs
Copy link

In my team we had the same situation as @tvvignesh, we ended up adding react-dnd on top Data Grid Pro to implement to those features @flaviendelangle mentions:

  1. Moving rows between the parent.
  2. Moving rows inside different parents depending on the nesting level.

Looking forward to this release too. Thanks in advance.

@tvvignesh
Copy link

tvvignesh commented Jul 18, 2022

@flaviendelangle We were trying to use the tree hierarchy in the MUI data grid. While the tree worked well, this is what we wanted to do:

  1. Move rows within a group in the tree during which we update the sequence against the group in the backend
  2. Move rows in between groups in the tree during which we want to update the group name in the backend
  3. Reorder groups during which the sequence of groups changes in the backend

We are trying to build chatbot dialog flows using the data grid for our product which is why we are looking for this. Thanks in advance.

@DanailH
Copy link
Member Author

DanailH commented Jul 20, 2022

Maybe it's time to prioritize this one. It will most likely be only available for v6 because it will utilize the new row structure but maybe there is a way to also have it in v5 with minimal effort. It's probably worth investigating a bit to know what is possible.

@horaciosystem
Copy link

Any updates on this?

@horaciosystem
Copy link

@edwinvrgs

Currently when row grouping or Tree Data is used the row reordering feature is disabled.

It would be awesome if you create and share a code sandbox with your solution ✨

@coladaag
Copy link

Hey guys. Would be pretty awesome to get this done ASAP as we moved our lists to your lib but as we're using tree-data this is an essential feature. Any timeline on that?

@aludin
Copy link

aludin commented Jan 9, 2023

We are also dependent on this feature, which is quite essential for us.

@NilsNathorst
Copy link

This will be a most welcome feature!

@joserodolfofreitas joserodolfofreitas added the plan: Premium Impact at least one Premium user label Jan 17, 2023
@cherniavskii cherniavskii added feature: Reordering Related to the data grid Reordering feature umbrella For grouping multiple issues to provide a holistic view labels Jan 17, 2023
@f4bienk
Copy link

f4bienk commented Jan 25, 2023

We are also depend on this feature to be released.

@ArturoTorresMartinez
Copy link

Also depend on this feature quite heavily

@moutazsadeh
Copy link

When is this expected to be ready? We depend on this feature also heavily

@lwestenberg
Copy link

we also depend on this feature, hope to see it soon

@Ut1998
Copy link

Ut1998 commented Mar 16, 2023

Summary 💡

Follow up to #206

Currently, when Row Grouping or Tree Data is used, the row reordering feature is disabled. This was intentionally made so in order to ship the feature quicker. Also, at the time, there were a few unanswered questions regarding how the reordering will work when you try to move a child row out of the parent as well as moving a parent to become a child of another parent.

This issue is to track the demand for a feature like that and ultimately start working on the implementation. Last but not least, it has to be decided if a feature add-on like this should be part of the Pro or the Premium plan

Advanced Drag and Drop Behaviors

"Row Reordering" doesn't properly include all the behaviors expected from dragging and dropping rows. It is one of the possible outcomes of dragging a row to drop it into a different position.

When a row is dragged to a different position, users expect:

Plain data

  • Change a row's displayed order.
    The internal order of the rows is updated, with the possibility to make the order persistent through the callback onRowOrderChange

Tree data

  • [data grid] Change a row's hierarchy in Tree Data by dragging a leaf to a different parent node #7774
    The treeDataPath value needs to be updated; following getTreeDataPath, we need a setTreeDataPath that receives the row and the new path array, based on where the row was dropped.
    Because getTreeDataPath is optional, and by default, we use the path field, we may additionally need an optional callback onTreeDataPathUpdate.
  • Change a row's displayed order inside its parent group.
    The internal order of the rows in a given group is updated, with the possibility to make the order persistent through the callback onRowOrderChange. In this case, oldIndex and targetIndex is based only on the indexes inside the given group.

Both behaviors in Tree Data should work combined or independently

Row Grouping

  • [data grid] Change a row's group in Row Grouping with drag and drop #7775
    The field value referenced by the grouped column needs to be updated; The new value is based on the sibling's rows where the row was dropped. We may need onRowGroupChange to pass this new value and the row that is getting updated.
  • Change a row's displayed order inside its parent group.
    The internal order of the rows in a given group is updated, with the possibility to make the order persistent through the callback onRowOrderChange. In this case, oldIndex and targetIndex is based only on the indexes inside the given group.

Both behaviors Row Grouping should work combined or independently

When can we expect this feature for row reordering in mui data grid.
Is there any solution there or do we need to propose a solution for this.

@DanailH
Copy link
Member Author

DanailH commented Mar 16, 2023

Hey, @Ut1998 I apologize for the delay but we had more pressing features and the release of v6 that needed to be shipped. That being said part of this feature is scheduled to be worked on in this quarter. You can track the progress here -> #3377

@Ut1998
Copy link

Ut1998 commented Mar 16, 2023

HI @DanailH, thank you for the response, so is there any expected timeline for this feature to get released?

@joserodolfofreitas
Copy link
Member

Hi @Ut1998, from those functionalities listed with checkboxes, which of those is the most relevant to your use case?

@Ut1998
Copy link

Ut1998 commented Mar 22, 2023

Hi @joserodolfofreitas, The first one under Row Grouping is most relevant for our use case, second one somehow I tried to achieve. If needed I can provide solution for the second point in Row Grouping. (So that I can also be a contributor to MUI).

@joserodolfofreitas joserodolfofreitas changed the title [data grid] Row reorder for Row Grouping and Tree Data [data grid] Advanced drag and drop behaviors: Row reordering in Row Grouping and Tree Data Mar 22, 2023
@Ut1998
Copy link

Ut1998 commented Mar 23, 2023

hi @DanailH , is it possible to achieve below use case in Tree Data Grid.

  1. Suppose we have an action button (Add) on parent level and when we click on Add, then a child row should get added.
  2. And nesting this to at least 2 levels, i.e, the child that gets added, will have a Add button, which in turn add a grand child to the child.
  3. And the expand icon should be only there if a row has child components.

@DanailH
Copy link
Member Author

DanailH commented Mar 23, 2023

@Ut1998 you can check here for more details https://mui.com/x/react-data-grid/editing/#full-featured-crud-component but the short answer is - yes. To create a child row you need to set the appropriate model and provide the path to that child row.

@Ut1998
Copy link

Ut1998 commented Mar 24, 2023

hi @joserodolfofreitas, is there a feature in MUI tree data grid, in which if we search the row based on any column value, and the searched result is in the nth child of the row, then it should expand that row.

@joserodolfofreitas
Copy link
Member

joserodolfofreitas commented Mar 24, 2023

The first one under Row Grouping is most relevant for our use case, second one somehow I tried to achieve. If needed I can provide solution for the second point in Row Grouping. (So that I can also be a contributor to MUI).

Thanks for the feedback and willing to contribute, @Ut1998!

is there a feature in MUI tree data grid, in which if we search the row based on any column value, and the searched result is in the nth child of the row, then it should expand that row.

This is a bit off-topic, so you may need to open a specific issue to discuss this. The short answer is no. There's no out-of-the-box that offers this, but you can achieve this behavior by using the gridSelectors to get filtered rows' ids and the setRowChildrenExpansion method on the apiRef to expand the rows.

@vicinik
Copy link

vicinik commented Jun 23, 2023

Are there any updates on this feature? We would need both functionalities

  • Row reordering inside a group
  • Row movement between groups with inherent parent updates

Is there an ETA for the feature? Do you maybe need help with the implementation?

Thanks :)

@coladaag
Copy link

coladaag commented Jun 23, 2023 via email

@afternoon2
Copy link

Also, having column reordering on row grouping would be nice as well!

@Chrisbekker
Copy link

We also need row reordering inside a group (i.e. parent-child relationship) as well as between groups. When will this feature be released?

@iii-huang7017
Copy link

Row reordering inside a group

@scarqin
Copy link

scarqin commented Dec 1, 2023

We are also depend on this feature to be released.

@osheral
Copy link

osheral commented Mar 12, 2024

Need this feature.

@DoubleDebug
Copy link

Any update on this feature?

If it's hard to handle all advanced scenarios, maybe just focus on the simple ones first.
For example, it would be nice to have row reordering for the parent (top level) rows.

Either way, my company would love to have this feature!

@coladaag
Copy link

coladaag commented Apr 3, 2024

After many months without update on this it would be great to get some kind of feedback from the dev-team. For the community is some kind of blind flight.

@Keanottesen
Copy link

We are also depend on this feature to be released.

@Kavan72
Copy link

Kavan72 commented May 13, 2024

We are also depend on this feature to be released.

+1

@juanp83
Copy link

juanp83 commented Jun 4, 2024

Need these features too!

@tunganh-phamba
Copy link

we also need these features - from Premium Customer

@AO19
Copy link

AO19 commented Jun 10, 2024

@DanailH An update on these features is overdue, please provide some status update. (Premium)

@6r3al
Copy link

6r3al commented Jun 27, 2024

@DanailH @joserodolfofreitas @flaviendelangle @cherniavskii
Hi would you have any updates on this one by any chance? Is it being worked on? Is there any ETA?
We would need row reordering within a group in priority, happy to wait for the other features for now.
Pro Customer

@joserodolfofreitas
Copy link
Member

joserodolfofreitas commented Jun 27, 2024

@6r3al, there is no ETA at this time, but from all the different features covered in this issue, reordering within row grouping is the highest priority. We may be able to tackle it soon.

(It's worth mentioning that it's going to follow it's "parent" feature and be under the Premium plan)

@6r3al
Copy link

6r3al commented Jul 9, 2024

Hi @joserodolfofreitas, thanks for getting back to me. You mentioned your team should be able to tackle it soon. Any insight of how soon is "soon" 😃?
My company is considering moving from MUI to a competitor who offers such functionalities, this is a must have for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! feature: Reordering Related to the data grid Reordering feature new feature New feature or request plan: Premium Impact at least one Premium user umbrella For grouping multiple issues to provide a holistic view waiting for 👍 Waiting for upvotes
Projects
None yet
Development

No branches or pull requests