mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
3.9k stars 1.18k forks source link

[data grid] render a value for the leave field #13207

Open tschrijvers1999 opened 1 month ago

tschrijvers1999 commented 1 month ago

The problem in depth

I was wondering if it is possible to edit the leaffield. I build the following MUI grid, however I would like to use the space below part (which is a group) to show tasks:

image

Part and a few other columns are also pinned to the left.

I have a few options in mind to save some space on the left and show the full part name:

Other suggestions are also welcome, let me know if you can help me!

Your environment

`npx @mui/envinfo` ``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```

Search keywords: colspan, leaffield Order ID: 89694

michelengelen commented 1 month ago

Would this be the feature you are looking for: Show value for the leaves?

tschrijvers1999 commented 1 month ago

@michelengelen yes, however I cannot edit this field. Which I would like to do, otherwise it is not useful for me to have it there.

michelengelen commented 1 month ago

Yes, that is currently not possible. @joserodolfofreitas is there a feature planned to render a custom leaffield, or just use the leaffield as is from the coldef?

tschrijvers1999 commented 1 month ago

@michelengelen using colspan for the pinned group is also not possible? Since otherwise the column for the grouped parts needs to be really big, which causes a lot of useless whitespace.

michelengelen commented 1 month ago

I don't think so ... I will test this tomorrow when I am back at my desk! 👍🏼

michelengelen commented 1 month ago

@tschrijvers1999 I tried today, but couldn't make it work.

@romgrk do you have any idea if this is possible in some way?

Otherwise I would consider this a feature request. Shouldn't be that hard to allow for editing in the leaffield. Would that be fine @tschrijvers1999?

tschrijvers1999 commented 1 month ago

@michelengelen Thanks for looking into it.

If another solution is not possible than a feature request is fine. How long does such a request usually take before it is processed?

michelengelen commented 1 month ago

It really depends on the complexity and the workload the team is experiencing. To speed things up you can also pick this up yourself and open a PR with a solution. 👍🏼

tschrijvers1999 commented 4 weeks ago

I do not have enough experience, so I will wait for the new feature and workaround with an extra column for now.

romgrk commented 4 weeks ago

It should be possible to use the renderCell field to customize the logic.

tschrijvers1999 commented 4 weeks ago

@romgrk do you have an example of how this should work? I guess I should than create a normal column and in rendercell make some logic such that it appears underneath the group (as a leaf field)?

romgrk commented 4 weeks ago

Documentation here: https://mui.com/x/react-data-grid/row-grouping/#grouping-rows-with-custom-cell-renderer