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

MudDataGrid: Add styles for resizing div #43

Merged

Conversation

TobiasBreuer
Copy link

@TobiasBreuer TobiasBreuer commented Apr 11, 2022

Feature to allow resizing of columns

Description

Allows resizing of individual columns

How Has This Been Tested?

BUnit tests and manual testing.
Example added to docs

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@TobiasBreuer
Copy link
Author

@tjscience WIP of first shot for resizing. The easy part is when the grid itself is also not fixed in the width.
Next will be to allow column resizing in case the grid itself should remain its originally given size...

It's still an early stage demo but I think I'm moving into the right direction 😉

columnResize_Take1

@TobiasBreuer
Copy link
Author

@tjscience: In order to better support resizing when grid size is fixed, I would like to introduce a ColumnIndex parameter on the column class. This would also allow for later column re-ordering feature which most likely will come up at some time anyways.
Any objections from your side against such a property?

@tjscience
Copy link
Owner

@TobiasBreuer, no objection there. I thought I did have column re-ordering in phase 3 and we will need something like this for it. I will add that to the phase.

@tjscience
Copy link
Owner

I personally like the way that DevExpress handles resizing. There are three modes, NextColumn, ColumnsContainer (what you have done so far), and Disabled.

https://demos.devexpress.com/blazor/Grid/Columns

@TobiasBreuer
Copy link
Author

That's great! I actually am used to that behaviour as well (even though based on their Angular grid component - but the modes are the same there). And for this "NextColumn" feature, I like to have the deterministic order of columns based on the index parameter 😉

@tjscience
Copy link
Owner

Hi @TobiasBreuer. I just wanted to check-in to see if you are still working on this. Let me know if you need anything. Thanks.

@TobiasBreuer
Copy link
Author

TobiasBreuer commented Apr 29, 2022 via email

@tjscience
Copy link
Owner

Take your time. No rush at all.

@TobiasBreuer
Copy link
Author

@tjscience: Implementation finished for both resizing variants:
columnResizeContainer

columnResizeColumn

Please have a look and let me know what you think.
Best regards!

@TobiasBreuer TobiasBreuer marked this pull request as ready for review May 4, 2022 09:28
@TobiasBreuer
Copy link
Author

Looks like pipeline is not happy.
Will do another rebase and update the PR asap.

@TobiasBreuer
Copy link
Author

There is a failing test now but this does not seem to be related to my changes actually:
image

@tjscience
Copy link
Owner

I will take a look, thanks.

@tjscience
Copy link
Owner

This looks good. Thanks again!

@tjscience tjscience merged commit db56630 into tjscience:datagrid_phase3 May 4, 2022
@tjscience
Copy link
Owner

I have merged it and it works pretty well. Great job! I modified the example a bit to make it more consistent with how the examples work and also fixed a typo, but everything else is working well.

The one thing that I think we should change here is the css to change the cursor. Right now, it only shows up when the user hovers over the resizer. However, if you are in the process of resizing and you do not go super slow, the cursor toggles back and forth between the pointer and the resize column. I think that it would be better to change the cursor for the entire data grid when we are resizing. Let me know your thoughts and if that is something that you know how to do.

@TobiasBreuer TobiasBreuer deleted the feature/column-resize branch May 4, 2022 14:44
@TobiasBreuer
Copy link
Author

@tjscience: Good idea with the cursor improvements. I've created #55 for it.
It improves the situation most of the time, but when reaching the options buttons or the column title it still changes back to pointer. See also my comment on that PR 😉
Best regards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants