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

[DataGrid] Refactor/Remove ColumnReorderApi #1201

Closed
dtassone opened this issue Mar 10, 2021 · 3 comments · Fixed by #1299
Closed

[DataGrid] Refactor/Remove ColumnReorderApi #1201

dtassone opened this issue Mar 10, 2021 · 3 comments · Fixed by #1299
Assignees
Labels
breaking change new feature New feature or request
Milestone

Comments

@dtassone
Copy link
Member

Summary 💡

Those methods attached to apiRef are actually event handlers and should not be on apiRef.
ApiRef goal is to allow users to manipulate the grid.
startResizeOnMouseDown, onColItemDragStart, onColHeaderDragOver... are not meaningful.

Something like options.onColumnResize or options.onColumnReordered are more appropriate.
To get the effect required by those methods, we can just publish the event from the component and subscribe to the event in the hook to handle it.

We can also provide a setColumnWidth method on the api that would allow to only update the col width, using the state, and firing onColumnResize once done.

Similarly we can provide a setColumnIndexmethod on the api that would allow to update the col position, using the state, and firing onColumnReorder event once done.

related to #1167

@dtassone dtassone added status: waiting for maintainer These issues haven't been looked at yet by a maintainer new feature New feature or request and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 10, 2021
@DanailH
Copy link
Member

DanailH commented Mar 11, 2021

I agree. There was a similar request for having an onColumnReordered on the grid itself.

@oliviertassinari oliviertassinari changed the title Refactor/Remove ColumnReorderApi and ColumnResizeApi [DataGrid] Refactor/Remove ColumnReorderApi and ColumnResizeApi Mar 13, 2021
@bushev
Copy link

bushev commented Mar 23, 2021

Hey @DanailH,

The feature is quite essential for our app. What's the approximate ETA?

@dtassone
Copy link
Member Author

FYI @m4theushw is going to refactor onColumnReorder as part of #1250

We can create a separate issue for onColumnResize

@dtassone dtassone changed the title [DataGrid] Refactor/Remove ColumnReorderApi and ColumnResizeApi [DataGrid] Refactor/Remove ColumnReorderApi Mar 25, 2021
@oliviertassinari oliviertassinari added this to the Sprint 14 milestone Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change new feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants