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] Introduce a maxWidth property in GridColDef #3550

Merged
merged 10 commits into from Jan 20, 2022

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Jan 4, 2022

Closes #2174

The next step would be to improve the flex behavior to respect the CSS specification (#3091 for instance).

https://deploy-preview-3550--material-ui-x.netlify.app/components/data-grid/columns/#resizing

@flaviendelangle flaviendelangle added the component: data grid This is the name of the generic UI component, not the React module! label Jan 4, 2022
@flaviendelangle flaviendelangle self-assigned this Jan 4, 2022
@flaviendelangle flaviendelangle marked this pull request as draft January 4, 2022 14:28
@flaviendelangle flaviendelangle marked this pull request as ready for review January 5, 2022 08:27
@github-actions
Copy link

github-actions bot commented Jan 5, 2022

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 5, 2022
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 6, 2022
Copy link
Member

@cherniavskii cherniavskii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 19, 2022
@mui-bot
Copy link

mui-bot commented Jan 19, 2022

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 141.7 306.2 194.8 204.16 61.161
Sort 100k rows ms 255.9 690.8 582.8 524.48 159.669
Select 100k rows ms 144.4 340.8 203.4 212.7 70.74
Deselect 100k rows ms 90.1 199.4 175.7 147.66 37.503

Generated by 🚫 dangerJS against c4e4d6a

@flaviendelangle flaviendelangle merged commit 1e42469 into mui:master Jan 20, 2022
@flaviendelangle flaviendelangle deleted the max-width branch January 20, 2022 09:35
@flaviendelangle flaviendelangle mentioned this pull request Jan 21, 2022
@oliviertassinari oliviertassinari added the new feature New feature or request label Jan 21, 2022
@oliviertassinari
Copy link
Member

@flaviendelangle I have tried the use case raised in #2174 (comment) (reading the git diff, I had a few doubts about the correctness). It doesn't seem to work correctly. I would expect the last column of the second demo to be full-width. Proof: https://codesandbox.io/s/columnsizinggrid-material-demo-forked-nhcv3?file=/package.json.

      <div style={{ height: 200, width: "100%" }}>
        <DataGridPro
          columns={[
            { field: "id" },
            { field: "username", width: 100 },
            { field: "age", resizable: false, flex: 1 }
          ]}
          rows={rows}
        />
      </div>
      <div style={{ height: 200, width: "100%" }}>
        <DataGridPro
          columns={[
            { field: "id" },
            { field: "username", flex: 1, maxWidth: 100 },
            { field: "age", resizable: false, flex: 1 }
          ]}
          rows={rows}
        />
      </div>

Screenshot 2022-01-22 at 00 50 55

I have tried with AG Grid, it seems correct: https://plnkr.co/edit/WJCcSwIr69GwJdoc.

How about we open a new GitHub issue?

@flaviendelangle
Copy link
Member Author

You are right 👍

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! new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DataGrid] Introduce maxWidth in GridColDef
4 participants